I am tyring to have the password and username of a user that that types in appear in a file
Forum Thread: Trying to Create a .Php File That Stores User Inputs
- Hot
- Active
-
Forum Thread: When My Kali Linux Finishes Installing (It Is Ready to Boot), and When I Try to Boot It All I Get Is a Black Screen. 8 Replies
4 days ago -
Forum Thread: HACK ANDROID with KALI USING PORT FORWARDING(portmap.io) 12 Replies
1 wk ago -
Forum Thread: Hydra Syntax Issue Stops After 16 Attempts 2 Replies
1 mo ago -
Forum Thread: Hack Instagram Account Using BruteForce 208 Replies
1 mo ago -
Forum Thread: Metasploit reverse_tcp Handler Problem 47 Replies
2 mo ago -
Forum Thread: How to Train to Be an IT Security Professional (Ethical Hacker) 22 Replies
3 mo ago -
Metasploit Error: Handler Failed to Bind 41 Replies
3 mo ago -
Forum Thread: How to Hack Android Phone Using Same Wifi 21 Replies
3 mo ago -
How to: HACK Android Device with TermuX on Android | Part #1 - Over the Internet [Ultimate Guide] 177 Replies
3 mo ago -
How to: Crack Instagram Passwords Using Instainsane 36 Replies
3 mo ago -
Forum Thread: How to Hack an Android Device Remotely, to Gain Acces to Gmail, Facebook, Twitter and More 5 Replies
3 mo ago -
Forum Thread: How Many Hackers Have Played Watch_Dogs Game Before? 13 Replies
3 mo ago -
Forum Thread: How to Hack an Android Device with Only a Ip Adress 55 Replies
4 mo ago -
How to: Sign the APK File with Embedded Payload (The Ultimate Guide) 10 Replies
4 mo ago -
Forum Thread: How to Run and Install Kali Linux on a Chromebook 18 Replies
5 mo ago -
Forum Thread: How to Find Admin Panel Page of a Website? 13 Replies
6 mo ago -
Forum Thread: can i run kali lenux in windows 10 without reboting my computer 4 Replies
6 mo ago -
Forum Thread: How to Hack School Website 11 Replies
6 mo ago -
Forum Thread: Make a Phishing Page for Harvesting Credentials Yourself 8 Replies
6 mo ago -
Forum Thread: Creating an Completely Undetectable Executable in Under 15 Minutes! 38 Replies
8 mo ago
-
How To: Dox Anyone
-
How To: Crack Shadow Hashes After Getting Root on a Linux System
-
How To: Crack SSH Private Key Passwords with John the Ripper
-
How To: Hack Apache Tomcat via Malicious WAR File Upload
-
How To: Exploit Shellshock on a Web Server Using Metasploit
-
How To: Use Burp & FoxyProxy to Easily Switch Between Proxy Settings
-
How To: Gain SSH Access to Servers by Brute-Forcing Credentials
-
How To: Target Bluetooth Devices with Bettercap
-
Exploit Development: How to Write Specific Values to Memory with Format String Exploitation
-
How To: Scan for Vulnerabilities on Any Website Using Nikto
-
How To: Crack Password-Protected Microsoft Office Files, Including Word Docs & Excel Spreadsheets
-
Hack Like a Pro: How to Find Directories in Websites Using DirBuster
-
How To: Write an XSS Cookie Stealer in JavaScript to Steal Passwords
-
Hacking Windows 10: How to Dump NTLM Hashes & Crack Windows Passwords
-
How To: Extract Bitcoin Wallet Addresses & Balances from Websites with SpiderFoot CLI
-
How To: Create Rainbow Tables for Hashing Algorithms Like MD5, SHA1 & NTLM
-
How To: Use Mitaka to Perform In-Browser OSINT to Identify Malware, Sketchy Sites, Shady Emails & More
-
How To: Exploit EternalBlue on Windows Server with Metasploit
-
How To: Find Identifying Information from a Phone Number Using OSINT Tools
-
BT Recon: How to Snoop on Bluetooth Devices Using Kali Linux
1 Response
PHP is a server-side scripting language that preprocesses and manipulates HTML among other things. The PHP file itself would likely be the file for the webpage that stores the HTML, PHP, JS, CSS, etc. code.
What you would want to do is create forms in HTML, capture the form data with PHP global variables (i.e. $_POST), then still using PHP tell it to store that information in a separate file (a file that is not .php). You could go with CSV, txt, and many others. You could also have it uploaded straight into a database like MySQL. Your code for writing it to a .txt file would probably look something like this:
<form action="<?=$_SERVER['PHP_SELF'];>" method="post">
<input type="text" name="username" placeholder="username">
<br/>
<input type="password" name="password" placeholder="password">
<br/>
<input type="submit" name="submit">
</form>
<?php
if (array_key_exists("submit", $_POST)) {
$fp = "./usernames_and_passwords_list.txt";
$yourfile = fopen($fp, "a");
fwrite($yourfile, "Username: " . $POST["username"] . "\n" . "Password: " . $_POST["password"] . "\n");
fclose($yourfile);
}
?>
It's not perfect, but essentially that's what you need to capture usernames, passwords and more from PHP forms and store them in files.
If you are wanting to store user inputs from a source other than a webpage, then I would recommend learning a programming language like Python. The idea would still be the same though, get inputs which are stored in variables and then write those variables into files, using Python's syntax.
Javascript is also a possibility, but the implications are that this script is running on a browser or mobile application instead of on your server (unless you use node.js).
Share Your Thoughts