mirror of
				https://github.com/GTFOBins/GTFOBins.github.io
				synced 2025-10-26 14:27:18 +01:00 
			
		
		
		
	Add history
This commit is contained in:
		
							
								
								
									
										23
									
								
								_gtfobins/history.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								_gtfobins/history.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| --- | ||||
| functions: | ||||
|   file-write: | ||||
|     - description: | | ||||
|         Resulting file will contain additional timestamp lines in the format of `#1535795174` for each data line. | ||||
|     - code: | | ||||
|         LFILE=file_to_write | ||||
|         HISTCONTROL=ignorespace | ||||
|         history -c | ||||
|         DATA | ||||
|          history -w $LFILE  | ||||
|   file-read: | ||||
|     - description: The file content will be surrounded by your current bash history session content. | ||||
|     - code: | | ||||
|         LFILE=file_to_read | ||||
|         HISTTIMEFORMAT=$'\r\e[K' | ||||
|         history -r $LFILE | ||||
|         history | ||||
|   sudo-enabled: | ||||
|     - code: | | ||||
|         LFILE=file_to_read | ||||
|         sudo bash -c "HISTTIMEFORMAT=$'\r\e[K' && history -r $LFILE && history" | ||||
| --- | ||||
		Reference in New Issue
	
	Block a user